Nodeschnaps is a node.js compatibility layer for Java Javscript engines like Rhino. The main inspiration is to run ETL transformation with the same code we use in node.js to save development time.
We work hard to implement the full API of node.js. So you could load Nodeschnaps into your Rhino environment and use your node.js code without restrictions. Take a look at the current development status to get a overview of what we done so far.
- Rhino JS
- Pentaho Data-Integration (Kettle)
We plan to support the following platforms in the next time:
- Nashorn
npm install nodeschnaps
Install dev dependencies:
npm install
Run tests with rhinojs:
make test
Run tests with nodejs:
make testNode
Path to search for modules/files (Last must be the nodeschnaps lib folder).
A path to a module, what will be loaded at the start to modify the environment.
load('../loader.js');
NodeJS();
Load on Job (JavaScript):
new Function(
org.apache.commons.io.FileUtils.readFileToString(
new java.io.File(parent_job.getVariable('NODESCHNAPS_LOADER_FILE'))
)
)();
NodeJS();
Load on Transformation (Modified Java Script Value):
LoadScriptFile(getEnvironmentVar('NODESCHNAPS_LOADER_FILE'));
NodeJS();
For a example look at: kitchen-stove
As callback:
NodeJS(function(){
// Your code here ...
});
Or before:
// Your code here ...
NodeJS();