UNPKG

superchild

Version:

A smarter replacement for node.js's child_process module.

77 lines (51 loc) 2.22 kB
<!DOCTYPE html> <html> <head> <title>unlogger.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="public/stylesheets/normalize.css" /> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div class="container"> <div class="page"> <div class="header"> <h1>unlogger.js</h1> <div class="toc"> <h3>Table of Contents</h3> <ol> <li> <a class="source" href="json-sieve.html"> json-sieve.js </a> </li> <li> <a class="source" href="superchild.html"> superchild.js </a> </li> <li> <a class="source" href="unlogger.html"> unlogger.js </a> </li> </ol> </div> </div> <div class='highlight'><pre><span class="hljs-keyword">var</span> JSONSieve = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./json-sieve'</span>); <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">unlogger</span>(<span class="hljs-params">inStream</span>) </span>{ <span class="hljs-keyword">var</span> sieve = <span class="hljs-keyword">new</span> JSONSieve(); inStream = inStream || process.stdin; inStream.setEncoding(<span class="hljs-string">'utf8'</span>); inStream.on(<span class="hljs-string">'data'</span>, sieve.observe.bind(sieve)); inStream.once(<span class="hljs-string">'end'</span>, <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{ sieve.close(); }); <span class="hljs-keyword">return</span> sieve; } <span class="hljs-built_in">module</span>.exports = unlogger;</pre></div> <div class="fleur">h</div> </div> </div> </body> </html>