Sh3ll
OdayForums


Server : Apache
System : Linux 145.162.205.92.host.secureserver.net 5.14.0-611.45.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 1 05:56:53 EDT 2026 x86_64
User : tradze ( 1001)
PHP Version : 8.1.34
Disable Function : NONE
Directory :  /home/tradze/public_html/test.tradze.com/node-socket/node_modules/split/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/tradze/public_html/test.tradze.com/node-socket/node_modules/split/examples/pretty.js
var inspect = require('util').inspect
var es      = require('event-stream')     //load event-stream
var split   = require('../')

if(!module.parent) {
  es.pipe(                            //pipe joins streams together
    process.openStdin(),              //open stdin
    split(),                       //split stream to break on newlines
    es.map(function (data, callback) {//turn this async function into a stream
      var j 
      try {
        j = JSON.parse(data)          //try to parse input into json
      } catch (err) {
        return callback(null, data)   //if it fails just pass it anyway
      }
      callback(null, inspect(j))      //render it nicely
    }),
    process.stdout                    // pipe it to stdout !
    )
  }
  
// run this
// 
// curl -sS registry.npmjs.org/event-stream | node pretty.js 
//

ZeroDay Forums Mini