node-json-criteria
node-json-criteria copied to clipboard
Doesn't blend well with nodejs
I have a fairly complex nodejs script that i am trying to integrate this into, however I cannot get this to work at all in it. I added the require('babel/register') as the first line of my script, but my node script pretty much dies after that. I tried removing that line and i get the following error: [ReferenceError: regeneratorRuntime is not defined]. Any idea as to what is going on? Is there a version of this that is pure JS for use with Node v0.12?
Have you tried require("babel/polyfill");
instead at entry point of your script?
I was using this just now and this is what is required to have it run.
npm install --save babel-polyfill
npm install --save babel-register
npm install --save json-criteria
require("babel-polyfill");
require("babel-register");
var jc = require('json-criteria');
Very helpful library, by the way.
Might also be worth looking at the https://github.com/bebraw/grunt-umd so the module plays nice without babel. Happy to PR this as well
Yes, I'd like to modernize it a bit. I think we could drop babel completely now.
Modernizing this (dropping babel) would make this awesome library much more easier to install & use. 👍
Modernizing this (dropping babel) would make this awesome library much more easier to install & use. 👍
True, for now you may be interested in alternative https://github.com/appliedblockchain/assert-combinators - it works very well with typescript providing runtime type assertion, good for test assertions and normal code to bring untyped data into typed on the IO boundaries (whenever things like JSON.parse appear).
One of the fork already remove Babel: https://github.com/Manny27nyc/node-couchdb-query-engine/commit/cbe121bf1bcb1716f0a4e47ee346af8bbfc7980e