Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

get-stdin

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Issues
File Explorer

Advanced tools

get-stdin

Get stdin as a string or buffer

    9.0.0latest

Version published
Maintainers
1
Weekly downloads
18,502,714
increased by1.24%

Weekly downloads

Changelog

Source

Breaking

  • Require Node.js 12 8f70f58
  • This package is now pure ESM. Please read this.

https://github.com/sindresorhus/get-stdin/compare/v8.0.0...v9.0.0

Readme

Source

get-stdin

Get stdin as a string or buffer

Install

$ npm install get-stdin

Usage

// example.js import getStdin from 'get-stdin'; console.log(await getStdin()); //=> 'unicorns' $ echo unicorns | node example.js unicorns

API

Both methods returns a promise that is resolved when the end event fires on the stdin stream, indicating that there is no more data to be read.

getStdin()

Get stdin as a string.

In a TTY context, a promise that resolves to an empty string is returned.

getStdin.buffer()

Get stdin as a Buffer.

In a TTY context, a promise that resolves to an empty Buffer is returned.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

What is get-stdin?

Get stdin as a string or buffer

Is get-stdin popular?

The npm package get-stdin receives a total of 14,982,497 weekly downloads. As such, get-stdin popularity was classified as popular.

Is get-stdin well maintained?

We found that get-stdin demonstrated a not healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.

Last updated on 16 Apr 2021
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc