UNPKG

@learnly/simple-reader

Version:

Read input line by line, synchronously. Similar to Java Scanner

15 lines (9 loc) 386 B
### Intro Simple reader sync reader that will first try to provide lines from `process.env.INPUT_LINES`, otherwise wait for input. Waiting for input only works if TTY is supported. ### Usage #### nextLine() Get next line either from `process.env.INPUT_LINES` or from terminal. ``` const {nextLine} = require('@learnly/simple-reader'); const myInput = nextLine(); ```