Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Feb 25, 2024 via pnpm

read 1.0.7

read(1) for node programs
Package summary
Share
0
issues
1
license
2
ISC
Package created
7 Dec 2011
Version published
26 Aug 2015
Maintainers
6
Total deps
2
Direct deps
1
License
ISC

Issues

0
This package has no issues

Licenses

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
mute-stream@0.0.8
read@1.0.7
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of read 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
mute-stream0.0.82.6 kBISC
prod

Visualizations

Frequently Asked Questions

What does read do?

The "read" npm package is a useful tool that facilitates the reading of user input from stdin in Node.js programs. It has similar functionality to the 'readline' builtin's 'question()' method but incorporates additional features, allowing for a more bespoke usage tailored to specific requirements. Key features include setting a custom prompt, silencing output, replacing silenced characters, defining a timeout, setting a default value, enabling or disabling user edit of default value, defining a terminal type, setting input and output streams, and even providing an autocomplete callback.

How do you use read?

The usage of "read" in JavaScript is quite straightforward. First, you need to import the "read" module using the require function. Then, you can call the read function with two arguments - options and callback. Let's consider the following example:

var read = require("read");

// Set some options
var options = {
  prompt: "What's your name? ", 
  silent: false, 
  default: "Anonymous"
};

// Read user input, using the prompt defined above
read(options, function(er, name){
  if (er) {
    console.error("An error occurred: ", er);
  } else {
    console.log("Hello, " + name);
  }
});

Please note how the options argument allows for customization of the input prompt, the silence level, and the default value. The callback function processes the user input or handles any possible error.

Where are the read docs?

The "read" documentation can be found within the README file present on the "read" GitHub page, accessible via https://github.com/npm/read. The documentation provides detailed information on usage, various options for configuration, and contributing guidelines. For more in-depth details about 'readline' options such as completer, you can refer to the official Node.js readline API at https://nodejs.org/api/readline.html#readline_readline_createinterface_options.