Socket
Socket
Sign inDemoInstall

get-stdin

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    get-stdin

Easier stdin


Version published
Maintainers
1
Install size
2.78 kB
Created

Package description

What is get-stdin?

The get-stdin package is a simple utility that allows you to easily read stdin as a string or buffer in Node.js. It's useful for command-line tools that need to process input piped to them from the command line.

What are get-stdin's main functionalities?

Read stdin as a string

This feature allows you to read the standard input (stdin) as a string. It returns a promise that resolves with the entire input when the stdin stream ends.

const getStdin = require('get-stdin');

getStdin().then(input => {
  console.log(input);
});

Read stdin as a buffer

This feature allows you to read the standard input (stdin) as a buffer. It returns a promise that resolves with the entire input as a buffer when the stdin stream ends.

const getStdin = require('get-stdin');

getStdin.buffer().then(input => {
  console.log(input);
});

Other packages similar to get-stdin

Readme

Source

get-stdin Build Status

Easier stdin

Install

$ npm install --save get-stdin

Usage

// example.js
var stdin = require('get-stdin');

stdin(function (data) {
	console.log(data);
	//=> unicorns
});
$ echo unicorns | node example.js
unicorns

API

stdin(callback)

Get stdin as a string.

stdin.buffer(callback)

Get stdin as a buffer.

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 20 Jan 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc