@aux4/input

0.0.3 • Public • Published

input

Read STDIN input

Install

npm install @aux4/input

Usage

Read stdin as String

const Input = require('@aux4/input');

const string = await Input.readAsString();

Read stdin as JSON

const Input = require('@aux4/input');

const json = await Input.readAsJson();

...

const nested = await Input.readAsJson("$.nested");

Stream stdin as JSON

const Input = require('@aux4/input');

const stream = Input.stream();
stream.on('data', (data) => {
  // data is a JSON object
});

...

const stream = Input.stream("$.nested");
stream.on('data', (data) => {
  // data is a JSON object
});

Readme

Keywords

Package Sidebar

Install

npm i @aux4/input

Weekly Downloads

2

Version

0.0.3

License

Apache-2.0

Unpacked Size

13.5 kB

Total Files

5

Last publish

Collaborators

  • aux4-dev