gulp-js-to-json
Install with npm install gulp-js-to-json
Accepts require
-able javascript files, and attempts to stringify them as JSON.
Example
src (sample/sample.js
):
moduleexports = 'this': 'that''I''Can''be' 'executed' tabs:'*tab''*tab''*space' '*space' complex:'this is ' + 'my stuff' + 'more ' + 'words ' + 'yo '
gulp task:
gulp;
result (sample/sample.json
):
"this":"that\nI\nCan\nbe\nexecuted""tabs":"*tab\n*tab\n*space *space""complex":"this is my stuffmore words yo "
Test
Run tests with mocha test test/