cypher-loader
Advanced tools
Comparing version 0.0.1 to 0.1.0
var decypher = require('decypher'); | ||
function output(queries) { | ||
return 'module.exports = ' + JSON.stringify(queries); | ||
if (typeof queries === 'string') | ||
return 'module.exports = ' + JSON.stringify(queries) + ';'; | ||
return Object.keys(queries).map(function(k) { | ||
return 'exports[' + JSON.stringify(k) + '] = ' + JSON.stringify(queries[k]) + ';'; | ||
}).join('\n'); | ||
} | ||
@@ -6,0 +11,0 @@ |
{ | ||
"name": "cypher-loader", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Webpack loader for cypher query files.", | ||
@@ -32,3 +32,3 @@ "main": "loader.js", | ||
"dependencies": { | ||
"decypher": "^0.5.0" | ||
"decypher": "^0.6.1" | ||
}, | ||
@@ -35,0 +35,0 @@ "devDependencies": { |
# cypher-loader | ||
WIP | ||
A simple [webpack](https://webpack.github.io/) loader for [Cypher](http://neo4j.com/docs/stable/cypher-introduction.html) query files. | ||
## Installation | ||
```bash | ||
npm install --save-dev cypher-loader | ||
``` | ||
## Usage | ||
### Configuration | ||
```js | ||
module.exports = { | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.cypher$/, | ||
loader: 'cypher' | ||
} | ||
] | ||
} | ||
}; | ||
``` | ||
### Require | ||
```js | ||
var queries = require('cypher!./queries.cypher'); | ||
``` | ||
## Query files | ||
For more information about the query files themselves, you should check the [decypher](https://github.com/Yomguithereal/decypher#query-loader) library's documentation on the subject. | ||
## License | ||
[MIT](LICENSE.txt) |
3232
19
41
+ Addeddecypher@0.6.1(transitive)
- Removeddecypher@0.5.0(transitive)
- Removedlodash._baseassign@3.2.0(transitive)
- Removedlodash._basecopy@3.0.1(transitive)
- Removedlodash._basefor@3.0.3(transitive)
- Removedlodash._bindcallback@3.0.1(transitive)
- Removedlodash._createassigner@3.1.1(transitive)
- Removedlodash._getnative@3.9.1(transitive)
- Removedlodash._isiterateecall@3.0.9(transitive)
- Removedlodash.assign@3.2.0(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.isplainobject@3.2.0(transitive)
- Removedlodash.keys@3.1.2(transitive)
- Removedlodash.keysin@3.0.8(transitive)
- Removedlodash.restparam@3.6.1(transitive)
Updateddecypher@^0.6.1