Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/felquis/inout

Input data, transform it, transform it again and output the result
https://github.com/felquis/inout

Last synced: 1 day ago
JSON representation

Input data, transform it, transform it again and output the result

Awesome Lists containing this project

README

        

## In Out

> npm install inout --save

Example: find.js
```js
#!/usr/bin/env node

var In = require('inout');

In(process.argv)
(function (data) { return data.splice(2); })
(function (data) { return data[0]; })
(function (data) { console.log('Find: ', data); return data; })
(function (data) {
var exec = require('child_process').exec;

var child = exec('ls -a | grep ' + data, function(err, stdout, stderr) {
console.log(stdout);
});

return data;
});
```

Run:
> node find.js package

Output:
> Find: package
> package.json