Node.js modules you should know about: procstreams - good coders code, great reuse |
| Node.js modules you should know about: procstreams Posted: 24 Jan 2012 08:21 AM PST
The first post was about dnode - the freestyle rpc library for node, the second was about optimist - the lightweight options parser for node, the third was about lazy - lazy lists for node, the fourth was about request - the swiss army knife of HTTP streaming, the fifth was about hashish - hash combinators library, the sixth was about read - easy reading from stdin, the seventh was about ntwitter - twitter api for node, the eighth was about socket.io that makes websockets and realtime possible in all browsers, the ninth was about redis - the best redis client API library for node, the tenth was on express - an insanely small and fast web framework for node, the eleventh was semver - a node module that takes care of versioning, the twelfth was cradle - a high-level, caching, CouchDB client for node, the thirteenth was jsonstream - streaming JSON parsing library, the fourteenth was about everyauth - a module for authenticating your webapp with facebook, twitter, etc. Today I'm gonna introduce you to procstreams by Marco Rogers. Procstreams is a little experiment with shell scripting in node. Here is an example: var $p = require('procstreams'); $p('cat lines.txt').pipe('wc -l') .data(function(stdout, stderr) { console.log(stdout); // prints number of lines in the file lines.txt }); This example executes the shell command Here is another example: var $p = require('procstreams'); $p('mkdir foo') .and('cp file.txt foo/') .and('rm file.txt') .on('exit', function() { console.log('done'); }); This example executes The Procstreams also support See procstreams documentation on GitHub for full info on other thingies it supports. You can install npm install procstreams Procstreams on GitHub: https://github.com/polotek/procstreams. Sponsor this blog series!Doing a node.js company and want your ad to appear in the series? The ad will go out to 14,000 rss subscribers, 7,000 email subscribers, and it will get viewed by thousands of my blog visitors! Email me and we'll set it up! Enjoy!If you love these articles, subscribe to my blog for more, follow me on Twitter to find about my adventures, and watch me produce code on GitHub! |
| You are subscribed to email updates from good coders code, great reuse To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
| Google Inc., 20 West Kinzie, Chicago IL USA 60610 | |
No comments:
Post a Comment
Keep a civil tongue.