Skip to content

Reading from STDIN does not seem to work #64

@jhthorsen

Description

@jhthorsen

I'm trying to pipe data into module-deps but it fails:

$ cat robot.js | ./node_modules/.bin/module-deps -

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: path must be a string
    at /home/username/node_modules/module-deps/node_modules/browser-resolve/node_modules/resolve/lib/async.js:15:16
    at process._tickCallback (node.js:419:13)

Running module-deps with "robots.js" as input on the other hand works like a charm:

$ ./node_modules/.bin/module-deps robot.js 
[
{"file":"/home/username/robot.js","id":"/home/username/robot.js","source":"module.exports = function (s) { return s.toUpperCase() + '!' };\n","deps":{},"entry":true}
]

I'm not sure how the output should look when you pipe though... How will it know the path to the entry point? Will it simply have {"file":"-","id":"-",...}

$ nodejs --version
v0.10.33
$ npm info module-deps | grep version:
  version: '3.6.4',

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions