Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
pipe-args
Advanced tools
Readme
pipe-args adds support for unix piped arguments to your node CLI apps
pipe-args makes your node CLI apps to fully support unix pipelines, completely out of the box. Require the the pipe-args module and all the piped arguments are added to the process stdin transparently. It also integrates well with popular command line interface/parsers like yarg and commander.js.
$ npm install --save pipe-args
#!/usr/bin/env node
const pipe = require('pipe-args').load();
console.log(`The piped arg is ${process.argv[2]}`);
$ echo test | node index.js
$ The piped arg is test
You can define which commands allow the stdin to be copied to process.argv by
passing them in the options
object:
#!/usr/bin/env node
const pipe = require('pipe-args').load(['command']);
console.log(`The piped arg is ${process.argv[2]}`);
$ echo OK | node command index.js
$ The piped arg is OK
$ echo OK | node commandNotPiping index.js
$ The piped arg is null // stdin was not parsed into process.argv
pipe-args plays along with optstrings parsers such as yarg. The following yargs parser code:
#!/usr/bin/env node
const pipe = require('pipe-args').load();
const yargs = require('yargs')
const cli = yargs.demand(1)
console.log(cli.argv);
parses linux-style piped arguments as expected:
$ echo piped_arg | yargs-cli.js
$ { _: [ 'piped_arg' ], '$0': 'index.js' }
MIT © Gonçalo Pestana
FAQs
POSIX compliant pipe argument parser for node CLI apps
The npm package pipe-args receives a total of 26 weekly downloads. As such, pipe-args popularity was classified as not popular.
We found that pipe-args demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.