An easy-to-use prompt for Node.js.
# Using npm
npm install --save promptify
# Using yarn
yarn add promptify
const promptify = require("promptify");
let name = promptify("Enter your name");
console.log(`Hey, ${name}!`);
let pass = promptify("Enter your password", {
char: "*"
});
console.log(`You entered: ${pass}`);
There are few ways to get help:
Promptify(conf)
Creates a new Promptify
. In most of the cases,
there will be one such instance per process.
conf
: The Promptify
config:Promptify
instance.sync(message, defMsg, options)
Synchronous version of the prompt.
message
: The message do display.defMsg
: The default value.options
: An object containing the following fields:
char
(String): The character to display when writing something. For
example, if it's *
, the text characters will be replaced with *
.delimiter
(String): The delimiter between message and the value (default: ": "
).promptify()
Prompt a message to the user. The arguments are passed to the sync
method.
Have an idea? Found a bug? See how to contribute.
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
Bitcoin—You can send me bitcoins at this address (or scanning the code below): 1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
Thanks! :heart:
prompt-sync
. Thanks! :cake:If you are using this library in one of your projects, add it in this list. :sparkles:
tilda
cli-github
parrot-bot