New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sync-prompt

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sync-prompt

Synchronously prompt your user for command-line input.

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
53
increased by51.43%
Maintainers
1
Weekly downloads
 
Created
Source

sync-prompt

Build Status Dependency Status Coverage Status

Synchronously prompt users for command-line input. Do more on Node.js, with less.

Usage

Simply run npm install sync-prompt, and you should be good to go.

Example usage:

var prompt = require('sync-prompt').prompt;

var name = prompt('What is your name? ');
// User enters "Mike".

console.log('Hello, ' + name + '!');
// -> Hello, Mike!

var hidden = true;
var password = prompt('Password: ', hidden);
// User enters a password, but nothing will be written to the screen.

API

.prompt([question [, hidden = false]])

When called, it will prompt the user for a command line input.

Parameters

question

Type: string. Default value: undefined. Optional

When set to a string, the value of question will be outputed to the console.

hidden

Type: boolean. Default value: undefined. Optional, but requires question to be set to a string.

When set to true, none of the user's input will be written to the console. This is great for passwords.

Running Tests

Be sure that you have the dependencies installed, locally, for the project:

npm install

And then run the tests:

npm test

Code Coverage

You can run

npm run coverage

And see a summary of the code coverage on the command line.

You can get an in-depth coverage report in the generated coverage/lcov-report/index.html file.

Licence

Unless stated in file headers, the license is found in the LICENSE file.

Keywords

FAQs

Package last updated on 19 Nov 2013

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc