[Pkg-javascript-commits] [node-module-deps] 267/444: document transform stream
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 15 09:48:03 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-module-deps.
commit ac263a0ffdbbd1fc08137e0ba98232a6346f3bc5
Author: James Halliday <mail at substack.net>
Date: Mon Jul 21 19:27:33 2014 -0700
document transform stream
---
readme.markdown | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/readme.markdown b/readme.markdown
index 0e80d14..4432d46 100644
--- a/readme.markdown
+++ b/readme.markdown
@@ -11,11 +11,9 @@ walk the dependency graph to generate json output that can be fed into
var mdeps = require('module-deps');
var JSONStream = require('JSONStream');
-var stringify = JSONStream.stringify();
-stringify.pipe(process.stdout);
-
-var file = __dirname + '/files/main.js';
-mdeps(file).pipe(stringify);
+var md = mdeps();
+md.pipe(JSONStream.stringify()).pipe(process.stdout);
+md.end({ file: __dirname + '/files/main.js' });
```
output:
@@ -56,8 +54,9 @@ var mdeps = require('module-deps')
## var d = mdeps(files, opts={})
-Return a readable stream `d` of javascript objects from an array of filenames
-`files`.
+Return an object transform stream `d` that expects entry filenames or
+`{ id: ..., file: ... }` objects as input and produces objects for every
+dependency from a recursive module traversal as output.
Each file in `files` can be a string filename or a stream.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git
More information about the Pkg-javascript-commits
mailing list