🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

diamond-operator

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diamond-operator

stdin + arguments composite stream (aka <> or diamond)

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

diamond

stdin + arguments composite stream

install

npm install diamond

example

pipe stdin and content of files from command line to stdout:

var diamond = require('diamond');

diamond().pipe(process.stdout);

listen for 'next' event:

var diamond = require('diamond');

var stream = diamond();

stream.on('data', function(d) {
     console.log('data:', d);
});
stream.on('end', function() {
     console.log('end');
});
stream.on('next', function() {
    console.log('next stream!', stream.name);
});

by default, process.argv.slice(2) is used as list of files. You can pass your own list:

var program = require('commander');
var diamond = require('diamond');

program
  .version('0.0.1')
  .option('-c', 'Count chars')
  .option('-l,', 'Count lines')
  .parse(process.argv);

var stream = diamond(program.args);
// ...

Bitdeli Badge

Keywords

cli

FAQs

Package last updated on 06 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts