We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
init
Actually, I wanted to have this functionality:
myRL.init({ prompt: '> ' }).on('line', (line) => { //.... })
Sometimes, we need only one listener and can be done in a single line otherwise we did like this:
const myRL = require('serverline') myRL.init({ prompt: '> ' }) myRL.on('line', (line) => { // ... })
Instead we can do all of this in a single line:
require('serverline').init({ prompt: '> ' }).on('line', (line) => { //... })
I think we can achieve this using return this from the init function. I tried (commit) and it works fine for me but is it the right way to do it?
return this
Shall I make a PR or there is a better way to achieve this?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Actually, I wanted to have this functionality:
Sometimes, we need only one listener and can be done in a single line otherwise we did like this:
Instead we can do all of this in a single line:
I think we can achieve this using
return this
from the init function.I tried (commit) and it works fine for me but is it the right way to do it?
Shall I make a PR or there is a better way to achieve this?
The text was updated successfully, but these errors were encountered: