
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
Minimal and beginner-friendly CLI input utility for JavaScript.
Now supports structured inputs (JSON, arrays, objects) — added in v1.1.0
npm install ezinput
In examples/sum.js:
const input = require('ezinput')(); // default: reads from stdin
const t = input.int();
for (let i = 0; i < t; i++) {
const [a, b] = input.ints();
console.log(`Sum of ${a} + ${b}:`, a + b);
}
You can try out working examples inside the examples/ folder.
Runs the script with redirected input from a sample file.
npm run example
Prompts user to type values directly into the terminal.
npm run example-cmd
>>> 3
>>> 5 10
>>> 15 20
>>> 25 30
and press Ctrl+D to end input.
input.int() // Single integer
input.float() // Single float
input.ints() // Space-separated numbers (ints or floats)
input.strings() // Space-separated strings
input.line() // Raw line
input.lines(n) // Next n lines (string[])
input.numbers(n) // n lines of number arrays (2D array)
// v1.1.0 additions
input.json() // Parses JSON array or object (single or multiline)
input.array() // Parses array from JSON input
input.object() // Parses object from JSON input
CP-style stdin is good, but for scripting we’ll support:
const input = require('ezinput').interactive();
await input.ask('Enter number: ')
Works like real-time prompt() or readline.question().
input.fromEditor() → Temporary input via in-editor (like vim)
const input = require('ezinput')({ mode: 'interactive' }); // or 'batch'
npm test
We use jest and fs.readFileSync mocks for testing stdin input.
require('ezinput')()) for consistent staterequire('ezinput').reset(source) to reinitialize inputBuilt to fix JavaScript’s awkward input handling during CP and scripts. This utility mimics the ease of:
cin >> in C++input() in PythonScanner.nextInt() in JavaMIT
FAQs
Simple and readable command-line input utility for Node.js.
We found that ezinput demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.