maleck13 / readline

read line module for node js
94 stars 25 forks source link

Example not working #5

Closed tbo closed 9 years ago

tbo commented 9 years ago

This lib doesn't work as documented. I get the following error message, when I execute the code under "Usage":

[...]/test.js:2
       rl = readline('./somefile.txt');
            ^
TypeError: object is not a function
    at Object.<anonymous> ([...]/test.js:2:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:929:3
maleck13 commented 9 years ago

Interesting. What vers on node are you using

maleck13 commented 9 years ago

Seems in node 10 readline is also the name of a core module. I have published the same module to npm to linebyline. If you add this to your package.json and then change

require('readline') 

to

require('linebyline');

it should work as expected