1.0.6 • Published 4 years ago

inputsync v1.0.6

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

npm_module_inputsync

npm package to take command line inputs with Promise return

How to install

$ npm i inputsync

How to use

Include npm Package inputsync in you JS file

const InputSync = require("inputsync");

To take command line input

Using await

const name = await InputSync.getline("Your Name : ")
console.log( "Your name is : " + name )

//best practice with error handling
try{
  const name_withoutErr = await InputSync.getline("Your Name : ")
  //if no error in line above
  console.log( "Your name is : " + name_withoutErr )
}catch(e){
  console.error(e)
}

Using Promise.prototype.then()

InputSync.getline("Your favorite city : ").then( (input) => {
  console.log( "Your favorite city : " + input )
}, (err) => {
  console.error(err) //incase error is returned
})

Functions in the package

InputSync.getline(question)

question string

Returns Promise

How to Contribute

Email me at : b19kiit@gmail.com

Subject : Contribute to npm package inputsync

Body : Describe why & how would you like you contribute

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago