Skip to content

micnews/levelgraph-query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

levelgraph-query Build Status

Simple query language for levelgraph

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install levelgraph-query --save

Usage

import createQuery from 'levelgraph-query';
import levelgraph from 'levelgraph';
import level from 'level';

const db = levelgraph(level('yourdb'));
const query = createQuery(db);

// :subject -> db.v('subject')
// so the query below is translated to
// [{ subject: db.v('subject'), predicate: 'predicate', object: object }]
// so query(...) can be used in db.searchStream and/or db.search
db.searchStream(query(':subject-[predicate]->object'));

Tests

npm install
npm test

Dependencies

None

Dev Dependencies

  • ava: Futuristic test runner 🚀
  • babel-cli: Babel command line.
  • babel-core: Babel compiler core.
  • babel-preset-es2015: Babel preset for all es2015 plugins.
  • levelgraph: A graph database for Node.js and the browser built on top of LevelUp
  • package-json-to-readme: Generate a README.md from package.json contents
  • semistandard: All the goodness of feross/standard with semicolons sprinkled on top.
  • snazzy: Format JavaScript Standard Style as Stylish (i.e. snazzy) output

License

MIT

Generated by package-json-to-readme

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published