@@ -18,7 +18,7 @@ md.end({ file: __dirname + '/files/main.js' });
18
18
19
19
output:
20
20
21
- ```
21
+ ``` json
22
22
$ node example/deps.js
23
23
[
24
24
{"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
32
32
and you can feed this json data into
33
33
[ browser-pack] ( https://github.com/browserify/browser-pack ) :
34
34
35
- ```
35
+ ``` bash
36
36
$ node example/deps.js | browser-pack | node
37
37
main: 1055
38
38
```
@@ -149,15 +149,30 @@ in `process.env.NODE_PATH`
149
149
Input objects should be string filenames or objects with these parameters:
150
150
151
151
* ` 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.
152
154
* ` 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
154
156
155
157
or objects can specify transforms:
156
158
157
159
* `row.transform` - string name, path, or function
158
160
* `row.options` - transform options as an object
159
161
* `row.global` - boolean, whether the transform is global
160
162
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
+
161
176
# events
162
177
163
178
## d.on(' transform' , function (tr, file) {})
0 commit comments