Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thlorenz/promfig
Completes a given config by prompting the user for the missing properties.
https://github.com/thlorenz/promfig
Last synced: 15 days ago
JSON representation
Completes a given config by prompting the user for the missing properties.
- Host: GitHub
- URL: https://github.com/thlorenz/promfig
- Owner: thlorenz
- License: mit
- Created: 2013-07-01T02:15:24.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-09-04T20:17:03.000Z (about 11 years ago)
- Last Synced: 2024-10-18T00:13:03.228Z (20 days ago)
- Language: JavaScript
- Homepage:
- Size: 137 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# promfig [![build status](https://secure.travis-ci.org/thlorenz/promfig.png)](http://travis-ci.org/thlorenz/promfig)
Completes a given config by prompting the user for the missing properties.
```js
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](https://github.com/thlorenz/promfig/tree/master/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