promfig
Completes a given config by prompting the user for the missing properties.
Last updated 7 years ago by thlorenz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install promfig 
SYNC missed versions from official npm registry.

promfig build status

Completes a given config by prompting the user for the missing properties.

var promfig = require('promfig')
var properties = { 
    user      :  'Please enter your username :  '
  , password  :  'Please enter your password :  '
  , '@secret' :  'password'
  };
var config = { user: 'humptydumpty' };

promfig(
    properties
  , config 
  , function (err, config) {
      if (err) return console.error('err: ', err);
      console.log(config);
  }
);
➝  node username-password-one-given.js
Please enter your password :  ******
{ user: 'humptydumpty', password: 'humpty' }

more examples

Installation

npm install promfig

API

###promfig(properties : Object, config : Object, callback : Function)

Will complete the given config with by prompting user for missing properties.

properties

  • key/values where the value is the text with which to prompt the user for the property
  • @secret: special key which takes a string or [ string ] to configure properties that should be masked while the user inputs them

License

MIT

Current Tags

  • 0.1.2                                ...           latest (7 years ago)

3 Versions

  • 0.1.2                                ...           7 years ago
  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 11
Last Day 1
Last Week 0
Last Month 13
Dependencies (4)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |