bumble-bee
v0.0.0-pre.8
Published
A CLI for transforming data
Downloads
4
Readme
bumble-bee
bumble-bee is a data transformation CLI. Just provide a transformation script and pipe data to it.
Install
- $
npm i bumble-bee -g
Usage
- $
cowsay moo | bee -s replace -f replace-map.json
replace.js
:
module.exports = function({pipe, file}){
let map = JSON.parse(file);
for(var key in map){
if(map.hasOwnProperty(key)){
pipe = pipe.replace(key, map[key]);
}
}
return pipe;
};
Transformation scripts can return any value, even a Promise
.
replace-map.json
:
{
"moo": "foo"
}
Output:
_____
< foo >
-----
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
Options
-V, --version output the version number
-s, --script [module] Name of script to handle transformation
-f, --file [file] Path to input file to be passed to transformation
-h, --help output usage information