@@ -18,7 +18,7 @@ md.end({ file: __dirname + '/files/main.js' });
1818
1919output:
2020
21- ```
21+ ``` json
2222$ node example/deps.js
2323[
2424{"id" :" /home/substack/projects/module-deps/example/files/main.js" ,"source" :" var foo = require('./foo');\n console.log('main: ' + foo(5));\n " ,"entry" :true ,"deps" :{"./foo" :" /home/substack/projects/module-deps/example/files/foo.js" }}
@@ -32,7 +32,7 @@ $ node example/deps.js
3232and you can feed this json data into
3333[ browser-pack] ( https://github.com/browserify/browser-pack ) :
3434
35- ```
35+ ``` bash
3636$ node example/deps.js | browser-pack | node
3737main: 1055
3838```
@@ -149,15 +149,30 @@ in `process.env.NODE_PATH`
149149Input objects should be string filenames or objects with these parameters:
150150
151151* ` row.file` - filename
152+ * ` row.entry` - whether to treat this file as an entry point, defaults to
153+ ` true` . Set to ` false` to include this file, but not run it automatically.
152154* ` row.expose` - name to be exposed as
153- * ` row.noparse` when true , don' t parse the file contents for dependencies
155+ * ` row.noparse` - when true , don' t parse the file contents for dependencies
154156
155157or objects can specify transforms:
156158
157159* `row.transform` - string name, path, or function
158160* `row.options` - transform options as an object
159161* `row.global` - boolean, whether the transform is global
160162
163+ # output objects
164+
165+ Output objects describe files with dependencies. They have these properties:
166+
167+ * `row.id` - an identifier for the file, used in the `row.deps` prperty
168+ * `row.file` - path to the source file
169+ * `row.entry` - true if the file is an entry point
170+ * `row.expose` - name to be exposed as
171+ * `row.source` - source file content as a string
172+ * `row.deps` - object describing dependencies. The keys are strings as used
173+ in `require()` calls in the file, and values are the row IDs (file paths)
174+ of dependencies.
175+
161176# events
162177
163178## d.on(' transform' , function (tr, file) {})
0 commit comments