cypher-loader
Advanced tools
+6
-1
| 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 @@ |
+2
-2
| { | ||
| "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": { |
+38
-1
| # 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
36.66%19
26.67%41
925%+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated