{"_id":"@cljs-oss/module-deps","_rev":"6-50e6ec4ef93c4fc6db7d05b16bd05f08","name":"@cljs-oss/module-deps","description":"walk the dependency graph to generate json output that can be fed into browser-pack","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@cljs-oss/module-deps","version":"1.0.0","description":"walk the dependency graph to generate json output that can be fed into browser-pack","main":"index.js","bin":{"module-deps":"bin/cmd.js"},"dependencies":{"JSONStream":"^1.0.3","browser-resolve":"^1.7.0","cached-path-relative":"^1.0.0","concat-stream":"~1.5.0","defined":"^1.0.0","detective":"^4.0.0","duplexer2":"^0.1.2","inherits":"^2.0.1","parents":"^1.0.0","readable-stream":"^2.0.2","resolve":"^1.1.3","stream-combiner2":"^1.1.1","subarg":"^1.0.0","through2":"^2.0.0","xtend":"^4.0.0"},"devDependencies":{"tap":"^1.0.0","browser-pack":"^5.0.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/module-deps.git"},"homepage":"https://github.com/substack/module-deps","keywords":["dependency","graph","browser","require","module","exports","json"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"engines":{"node":">= 0.6"},"license":"MIT","gitHead":"a5ed230c4ed7cb45958e6944f3deb48ec0b2f2e3","bugs":{"url":"https://github.com/substack/module-deps/issues"},"_id":"@cljs-oss/module-deps@1.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"anmonteiro","email":"anmonteiro@gmail.com"},"dist":{"integrity":"sha512-Y7k7xI/142ycQajPh9QSXp1hd1AwZA2u4yQq9WZRRpuQm2pfj+Ke1eHx8TLrjrgvBD3rgm8UFozLMKxnWKXeVQ==","shasum":"b0de50b641ef6735c2117fd77bca95a78bf7ad6f","tarball":"https://registry.npmjs.org/@cljs-oss/module-deps/-/module-deps-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfFSepUytHFyVZvfgnxbGEcUMX+5EJb2nayzzNIOf0UgIgRC+Ykw13dmwYVEYrirN+6zDn8sB94LTiPFFVmmFbplM="}]},"maintainers":[{"name":"anmonteiro","email":"anmonteiro@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/module-deps-1.0.0.tgz_1501366875219_0.16072506364434958"}},"1.1.0":{"name":"@cljs-oss/module-deps","version":"1.1.0","description":"walk the dependency graph to generate json output that can be fed into browser-pack","main":"index.js","bin":{"module-deps":"bin/cmd.js"},"dependencies":{"JSONStream":"^1.0.3","browser-resolve":"^1.7.0","cached-path-relative":"^1.0.0","concat-stream":"~1.5.0","defined":"^1.0.0","detective":"^4.0.0","duplexer2":"^0.1.2","inherits":"^2.0.1","parents":"^1.0.0","readable-stream":"^2.0.2","resolve":"^1.1.3","stream-combiner2":"^1.1.1","subarg":"^1.0.0","through2":"^2.0.0","xtend":"^4.0.0","konan":"1.1.0","enhanced-resolve":"3.4.1"},"devDependencies":{"tap":"^1.0.0","browser-pack":"^5.0.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/cljs-oss/module-deps.git"},"homepage":"https://github.com/cljs-oss/module-deps","keywords":["dependency","graph","browser","require","module","exports","json"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"engines":{"node":">= 0.6"},"license":"MIT","gitHead":"0a86d6a0077006d622bfcfa9cf7ffdc14d5d1a1f","bugs":{"url":"https://github.com/cljs-oss/module-deps/issues"},"_id":"@cljs-oss/module-deps@1.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"anmonteiro","email":"anmonteiro@gmail.com"},"dist":{"integrity":"sha512-SSvHFkWEwOFCdIqYY9qN6kipOYOwEjQTTjqkx/mTgJC9EMVaY32Aa1YGy3xl4QW7vJwFNSDF3f4uv5r11tj+lA==","shasum":"b3b8cd5a28a3c02c8100931dabc08a55d84ba34a","tarball":"https://registry.npmjs.org/@cljs-oss/module-deps/-/module-deps-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXJylAefL8fJPYD0hmp1r3mQb7Rbu8VHL6/3tSQ9jaKAIhAO9iSmog4o9nGPtStvjo6NMnZC6wxlZbyS1U1G0wJj5+"}]},"maintainers":[{"name":"anmonteiro","email":"anmonteiro@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/module-deps-1.1.0.tgz_1502760431560_0.57102349284105"}},"1.1.1":{"name":"@cljs-oss/module-deps","version":"1.1.1","description":"walk the dependency graph to generate json output that can be fed into browser-pack","main":"index.js","bin":{"module-deps":"bin/cmd.js"},"dependencies":{"babel-traverse":"^6.23.1","babylon":"^6.15.0","JSONStream":"^1.0.3","browser-resolve":"^1.7.0","cached-path-relative":"^1.0.0","concat-stream":"~1.5.0","defined":"^1.0.0","detective":"^4.0.0","duplexer2":"^0.1.2","inherits":"^2.0.1","parents":"^1.0.0","readable-stream":"^2.0.2","resolve":"^1.1.3","stream-combiner2":"^1.1.1","subarg":"^1.0.0","through2":"^2.0.0","xtend":"^4.0.0","konan":"1.1.0","enhanced-resolve":"3.4.1"},"devDependencies":{"tap":"^1.0.0","browser-pack":"^5.0.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/cljs-oss/module-deps.git"},"homepage":"https://github.com/cljs-oss/module-deps","keywords":["dependency","graph","browser","require","module","exports","json"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"engines":{"node":">= 0.6"},"license":"MIT","gitHead":"15364402a29813d5ec8271ad53aed0ddf73f3df0","bugs":{"url":"https://github.com/cljs-oss/module-deps/issues"},"_id":"@cljs-oss/module-deps@1.1.1","_shasum":"62667f282164f3f10f6ab9f124ba416fd12439fa","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"dnolencog","email":"dnolen@cognitect.com"},"dist":{"shasum":"62667f282164f3f10f6ab9f124ba416fd12439fa","tarball":"https://registry.npmjs.org/@cljs-oss/module-deps/-/module-deps-1.1.1.tgz","integrity":"sha512-3NwL9ochqciZWLN7+Kr/Toawk+jnY78mLhBXABePw92/0JOpmq2W/6nlaQH0Uj6/X2ND98gNtM8Xu3OMr0iClQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCvtVO9w+XFzfHqH2fZbwWHc6jz+TlkNAsYn5OmJsZTgIgNb0cpDSmlKeuasR5rGvrVuuQ7IsDZch8cNVjDdb9GW4="}]},"maintainers":[{"email":"dnolen@cognitect.com","name":"dnolencog"},{"email":"anmonteiro@gmail.com","name":"anmonteiro"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/module-deps-1.1.1.tgz_1502897192026_0.7626623841933906"}}},"readme":"# module-deps\n\nwalk the dependency graph to generate json output that can be fed into\n[browser-pack](https://github.com/substack/browser-pack)\n\n[![build status](https://secure.travis-ci.org/substack/module-deps.png)](http://travis-ci.org/substack/module-deps)\n\n# example\n\n``` js\nvar mdeps = require('module-deps');\nvar JSONStream = require('JSONStream');\n\nvar md = mdeps();\nmd.pipe(JSONStream.stringify()).pipe(process.stdout);\nmd.end({ file: __dirname + '/files/main.js' });\n```\n\noutput:\n\n```\n$ node example/deps.js\n[\n{\"id\":\"/home/substack/projects/module-deps/example/files/main.js\",\"source\":\"var foo = require('./foo');\\nconsole.log('main: ' + foo(5));\\n\",\"entry\":true,\"deps\":{\"./foo\":\"/home/substack/projects/module-deps/example/files/foo.js\"}}\n,\n{\"id\":\"/home/substack/projects/module-deps/example/files/foo.js\",\"source\":\"var bar = require('./bar');\\n\\nmodule.exports = function (n) {\\n    return n * 111 + bar(n);\\n};\\n\",\"deps\":{\"./bar\":\"/home/substack/projects/module-deps/example/files/bar.js\"}}\n,\n{\"id\":\"/home/substack/projects/module-deps/example/files/bar.js\",\"source\":\"module.exports = function (n) {\\n    return n * 100;\\n};\\n\",\"deps\":{}}\n]\n```\n\nand you can feed this json data into\n[browser-pack](https://github.com/substack/browser-pack):\n\n```\n$ node example/deps.js | browser-pack | node\nmain: 1055\n```\n\n# usage\n\n```\nusage: module-deps [files]\n\n  generate json output from each entry file\n\n```\n\n# methods\n\n``` js\nvar mdeps = require('module-deps')\n```\n\n## var d = mdeps(opts={})\n\nReturn an object transform stream `d` that expects entry filenames or\n`{ id: ..., file: ... }` objects as input and produces objects for every\ndependency from a recursive module traversal as output.\n\nEach file in `files` can be a string filename or a stream.\n\nOptionally pass in some `opts`:\n\n* `opts.transform` - a string or array of string transforms (see below)\n\n* `opts.transformKey` - an array path of strings showing where to look in the\npackage.json for source transformations. If falsy, don't look at the\npackage.json at all.\n\n* `opts.resolve` - custom resolve function using the\n`opts.resolve(id, parent, cb)` signature that\n[browser-resolve](https://github.com/shtylman/node-browser-resolve) has\n\n* `opts.filter` - a function (id) to skip resolution of some module `id` strings.\nIf defined, `opts.filter(id)` should return truthy for all the ids to include\nand falsey for all the ids to skip.\n\n* `opts.postFilter` - a function (id, file, pkg) that gets called after `id` has\nbeen resolved. Return false to skip this file.\n\n* `opts.packageFilter` - transform the parsed package.json contents before using\nthe values. `opts.packageFilter(pkg, dir)` should return the new `pkg` object to\nuse.\n\n* `opts.noParse` - an array of absolute paths to not parse for dependencies. Use\nthis for large dependencies like jquery or threejs which take forever to parse.\n\n* `opts.cache` - an object mapping filenames to file objects to skip costly io\n\n* `opts.packageCache` - an object mapping filenames to their parent package.json\ncontents for browser fields, main entries, and transforms\n\n* `opts.fileCache` - an object mapping filenames to raw source to avoid reading\nfrom disk.\n\n* `opts.persistentCache` - a complex cache handler that allows async and persistent\n    caching of data. A `persistentCache` needs to follow this interface:\n    ```js\n    function persistentCache (\n        file, // the path to the file that is loaded\n        id,   // the id that is used to reference this file\n        pkg,  // the package that this file belongs to fallback\n        fallback, // async fallback handler to be called if the cache doesn't hold the given file \n        cb    // callback handler that receives the cache data\n    ) {\n        if (hasError()) {\n            return cb(error) // Pass any error to the callback\n        }\n\n        var fileData = fs.readFileSync(file)\n        var key = keyFromFile(file, fileData)\n\n        if (db.has(key)) {\n            return cb(null, {\n                source: db.get(key).toString(),\n                package: pkg, // The package for housekeeping\n                deps: {\n                    'id':  // id that is used to reference a required file\n                    'file' // file path to the required file\n                }\n            })\n        }\n        //\n        // The fallback will process the file in case the file is not\n        // in cache.\n        //\n        // Note that if your implementation doesn't need the file data\n        // then you can pass `null` instead of the source and the fallback will\n        // fetch the data by itself.\n        //\n        fallback(fileData, function (error, cacheableEntry) {\n            if (error) {\n                return cb(error)\n            }\n            db.addToCache(key, cacheableEntry)\n            cb(null, cacheableEntry)\n        })\n    }\n    ```\n\n* `opts.paths` - array of global paths to search. Defaults to splitting on `':'`\nin `process.env.NODE_PATH`\n\n* `opts.ignoreMissing` - ignore files that failed to resolve\n\n# input objects\n\nInput objects should be string filenames or objects with these parameters:\n\n* `row.file` - filename\n* `row.expose` - name to be exposed as\n* `row.noparse` when true, don't parse the file contents for dependencies\n\nor objects can specify transforms:\n\n* `row.transform` - string name, path, or function\n* `row.options` - transform options as an object\n* `row.global` - boolean, whether the transform is global\n\n# events\n\n## d.on('transform', function (tr, file) {})\n\nEvery time a transform is applied to a `file`, a `'transform'` event fires with\nthe instantiated transform stream `tr`.\n\n## d.on('file', function (file) {})\n\nEvery time a file is read, this event fires with the file path.\n\n## d.on('missing', function (id, parent) {})\n\nWhen `opts.ignoreMissing` is enabled, this event fires for each missing package.\n\n## d.on('package', function (pkg) {})\n\nEvery time a package is read, this event fires. The directory name of the\npackage is available in `pkg.__dirname`.\n\n# transforms\n\nmodule-deps can be configured to run source transformations on files before\nparsing them for `require()` calls. These transforms are useful if you want to\ncompile a language like [coffeescript](http://coffeescript.org/) on the fly or\nif you want to load static assets into your bundle by parsing the AST for\n`fs.readFileSync()` calls.\n\nIf the transform is a function, it should take the `file` name as an argument\nand return a through stream that will be written file contents and should output\nthe new transformed file contents.\n\nIf the transform is a string, it is treated as a module name that will resolve\nto a module that is expected to follow this format:\n\n``` js\nvar through = require('through2');\nmodule.exports = function (file, opts) { return through() };\n```\n\nYou don't necessarily need to use the\n[through2](https://github.com/rvagg/through2) module to create a\nreadable/writable filter stream for transforming file contents, but this is an\neasy way to do it.\n\nWhen you call `mdeps()` with an `opts.transform`, the transformations you\nspecify will not be run for any files in node_modules/. This is because modules\nyou include should be self-contained and not need to worry about guarding\nthemselves against transformations that may happen upstream.\n\nModules can apply their own transformations by setting a transformation pipeline\nin their package.json at the `opts.transformKey` path. These transformations\nonly apply to the files directly in the module itself, not to the module's\ndependants nor to its dependencies.\n\n## package.json transformKey\n\nTransform keys live at a configurable location in the package.json denoted by\nthe `opts.transformKey` array.\n\nFor a transformKey of `['foo','bar']`, the transformKey can be a single string\n(`\"fff\"`):\n\n``` json\n{\n  \"foo\": {\n    \"bar\": \"fff\"\n  }\n}\n```\n\nor an array of strings (`[\"fff\",\"ggg\"]`):\n\n``` json\n{\n  \"foo\": {\n    \"bar\": [\"fff\",\"ggg\"]\n  }\n}\n```\n\nIf you want to pass options to the transforms, you can use a 2-element array\ninside of the primary array. Here `fff` gets an options object with `{\"x\":3}`\nand `ggg` gets `{\"y\":4}`:\n\n``` json\n{\n  \"foo\": {\n    \"bar\": [[\"fff\",{\"x\":3}],[\"ggg\",{\"y\":4}]]\n  }\n}\n```\n\nOptions sent to the module-deps constructor are also provided under\n`opts._flags`. These options are sometimes required if your transform\nneeds to do something different when browserify is run in debug mode, for\nexample.\n\n# usage\n\n```\nmodule-deps [FILES] OPTIONS\n\n  Generate json output for the entry point FILES.\n\nOPTIONS are:\n\n  -t TRANSFORM  Apply a TRANSFORM.\n  -g TRANSFORM  Apply a global TRANSFORM.\n\n```\n\n# install\n\nWith [npm](http://npmjs.org), to get the module do:\n\n```\nnpm install module-deps\n```\n\nand to get the `module-deps` command do:\n\n```\nnpm install -g module-deps\n```\n\n# license\n\nMIT\n","maintainers":[{"email":"dnolen@cognitect.com","name":"dnolencog"},{"email":"anmonteiro@gmail.com","name":"anmonteiro"}],"time":{"modified":"2022-06-12T16:06:10.600Z","created":"2017-07-29T22:21:15.385Z","1.0.0":"2017-07-29T22:21:15.385Z","1.1.0":"2017-08-15T01:27:11.655Z","1.1.1":"2017-08-16T15:26:33.130Z"},"homepage":"https://github.com/cljs-oss/module-deps","keywords":["dependency","graph","browser","require","module","exports","json"],"repository":{"type":"git","url":"git://github.com/cljs-oss/module-deps.git"},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"bugs":{"url":"https://github.com/cljs-oss/module-deps/issues"},"license":"MIT","readmeFilename":"readme.markdown"}