Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prompt

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prompt - npm Package Compare versions

Comparing version 0.1.11 to 0.1.12

.travis.yml

2

examples/add-properties.js
/*
* add-properties.js: Example of how to add properties to an object using node-prompt.
* add-properties.js: Example of how to add properties to an object using prompt.
*

@@ -4,0 +4,0 @@ * (C) 2010, Nodejitsu Inc.

/*
* existing-properties.js: Example of using node-prompt with predefined properties.
* existing-properties.js: Example of using prompt with predefined properties.
*

@@ -4,0 +4,0 @@ * (C) 2010, Nodejitsu Inc.

/*
* history.js: Example of using the node-prompt history capabilities.
* history.js: Example of using the prompt history capabilities.
*

@@ -4,0 +4,0 @@ * (C) 2010, Nodejitsu Inc.

/*
* simple-prompt.js: Simple example of using node-prompt.
* simple-prompt.js: Simple example of using prompt.
*

@@ -4,0 +4,0 @@ * (C) 2010, Nodejitsu Inc.

/*
* property-prompt.js: Example of using node-prompt with complex properties.
* property-prompt.js: Example of using prompt with complex properties.
*

@@ -4,0 +4,0 @@ * (C) 2010, Nodejitsu Inc.

/*
* simple-prompt.js: Simple example of using node-prompt.
* simple-prompt.js: Simple example of using prompt.
*

@@ -4,0 +4,0 @@ * (C) 2010, Nodejitsu Inc.

@@ -38,7 +38,7 @@ /*

prompt.message = 'prompt';
prompt.delimiter = ':';
prompt.delimiter = ': ';
//
// Create an empty object for the properties
// known to `node-prompt`
// known to `prompt`
//

@@ -195,3 +195,3 @@ prompt.properties = {};

propName = prop.name || prop,
delim = prompt.delimiter + ' ',
delim = prompt.delimiter,
raw = [prompt.message, delim + name.grey, delim.grey],

@@ -201,4 +201,4 @@ read = prop.hidden ? prompt.readLineHidden : prompt.readLine,

if (prompt.override && prompt.override [propName]) {
return callback (null, prompt.override [propName])
if (prompt.override && prompt.override[propName]) {
return callback (null, prompt.override[propName])
}

@@ -265,3 +265,3 @@

// Log the resulting line, append this `property:value`
// pair to the history for `node-prompt` and respond to
// pair to the history for `prompt` and respond to
// the callback.

@@ -385,3 +385,3 @@ //

//
// Ignore errors from `.setRawMode()` so that `node-prompt` can
// Ignore errors from `.setRawMode()` so that `prompt` can
// be scripted in child processes.

@@ -400,3 +400,4 @@ //

case '\n': case '\r': case '\r\n': case '\u0004':
tty.setRawMode(false);
try { tty.setRawMode(false) }
catch (ex) { }
stdin.removeListener('data', data);

@@ -429,5 +430,5 @@ stdin.removeListener('error', callback);

// #### @property {Object|string} Property that the value is in response to.
// #### @value {string} User input captured by `node-prompt`.
// #### @value {string} User input captured by `prompt`.
// Prepends the `property:value` pair into the private `history` Array
// for `node-prompt` so that it can be accessed later.
// for `prompt` so that it can be accessed later.
//

@@ -434,0 +435,0 @@ prompt._remember = function (property, value) {

{
"name": "prompt",
"description": "A beautiful command-line prompt for node.js",
"version": "0.1.11",
"version": "0.1.12",
"author": "Nodejitsu Inc. <info@nodejitsu.com>",

@@ -14,3 +14,3 @@ "contributors": [

"type": "git",
"url": "http://github.com/nodejitsu/node-prompt.git"
"url": "http://github.com/flatiron/prompt.git"
},

@@ -28,3 +28,4 @@ "dependencies": {

"scripts": {
"test": "vows test/prompt-test.js --spec"
"test": "vows test/prompt-test.js --spec",
"test-all": "vows --spec"
},

@@ -31,0 +32,0 @@ "engines": {

@@ -1,2 +0,2 @@

# node-prompt
# prompt [![Build Status](https://secure.travis-ci.org/flatiron/prompt.png)](http://travis-ci.org/flatiron/prompt)

@@ -24,6 +24,6 @@ A beautiful command-line prompt for node.js

## Usage
Using node-prompt is relatively straight forward. There are two core methods you should be aware of: `prompt.get()` and `prompt.addProperties()`. There methods take strings representing property names in addition to objects for complex property validation (and more). There are a number of [examples][0] that you should examine for detailed usage.
Using prompt is relatively straight forward. There are two core methods you should be aware of: `prompt.get()` and `prompt.addProperties()`. There methods take strings representing property names in addition to objects for complex property validation (and more). There are a number of [examples][0] that you should examine for detailed usage.
### Getting Basic Prompt Information
Getting started with `node-prompt` is easy. Lets take a look at `examples/simple-prompt.js`:
Getting started with `prompt` is easy. Lets take a look at `examples/simple-prompt.js`:

@@ -112,3 +112,3 @@ ``` js

## Valid Property Settings
`node-prompt` uses a simple property system for performing a couple of basic validation operations against input received from the command-line. The motivations here were speed and simplicity of implementation to integration of pseudo-standards like JSON-Schema were not feasible.
`prompt` uses a simple property system for performing a couple of basic validation operations against input received from the command-line. The motivations here were speed and simplicity of implementation to integration of pseudo-standards like JSON-Schema were not feasible.

@@ -168,3 +168,3 @@ Lets examine the anatomy of a prompt property:

### Adding Properties to an Object
A common use-case for prompting users for data from the command-line is to extend or create a configuration object that is passed onto the entry-point method for your CLI tool. `node-prompt` exposes a convenience method for doing just this:
A common use-case for prompting users for data from the command-line is to extend or create a configuration object that is passed onto the entry-point method for your CLI tool. `prompt` exposes a convenience method for doing just this:

@@ -208,3 +208,3 @@ ``` js

Changing these allows you to customize the appearance of your prompts! In
addition, node-prompt supports ANSI color codes via the
addition, prompt supports ANSI color codes via the
[colors module](https://github.com/Marak/colors.js) for custom colors. For a

@@ -241,3 +241,3 @@ very colorful example:

[0]: https://github.com/nodejitsu/prompt/tree/master/examples
[0]: https://github.com/flatiron/prompt/tree/master/examples
[1]: http://nodejitsu.com
/*
* prompt-test.js: Tests for node-prompt.
* prompt-test.js: Tests for prompt.
*

@@ -22,3 +22,3 @@ * (C) 2010, Nodejitsu Inc.

prompt.start();
winston.info('These node-prompt tests are interactive');
winston.info('These prompt tests are interactive');
winston.info('Not following instructions will result in test failure');

@@ -25,0 +25,0 @@ return null;

/*
* prompt-test.js: Tests for node-prompt.
* prompt-test.js: Tests for prompt.
*

@@ -272,6 +272,6 @@ * (C) 2010, Nodejitsu Inc.

}
}/*,
},
"skip prompt with prompt.overide": {
topic: function () {
prompt.overide = { coconihet: 'whatever' }
prompt.override = { coconihet: 'whatever' }
prompt.get('coconihet', this.callback);

@@ -282,3 +282,3 @@ },

}
}*/
}
},

@@ -300,3 +300,3 @@ "the addProperties() method": {

}).addBatch({
"When using node-prompt": {
"When using prompt": {
"the history() method": {

@@ -332,3 +332,3 @@ "when used inside of a complex property": {

}).addBatch({
"when using node-prompt": {
"when using prompt": {
topic: function () {

@@ -358,3 +358,3 @@ //

}).addBatch({
"when using node-prompt": {
"when using prompt": {
topic: function () {

@@ -361,0 +361,0 @@ //

Sorry, the diff of this file is not supported yet

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