{"name":"derequire","version":"2.0.2","description":"remove requires","main":"index.js","bin":{"derequire":"bin/cmd.js"},"scripts":{"test":"istanbul test _mocha test/test.js","perf":"node test/perf.js"},"files":["bin/cmd.js","index.js","plugin.js","readme.md"],"repository":{"type":"git","url":"git+https://github.com/calvinmetcalf/derequire.git"},"author":{"name":"Calvin Metcalf"},"license":"MIT","bugs":{"url":"https://github.com/calvinmetcalf/derequire/issues"},"homepage":"https://github.com/calvinmetcalf/derequire","dependencies":{"acorn":"^0.12.0","concat-stream":"^1.4.6","escope":"^2.0.6","through2":"^2.0.0","yargs":"^3.4.5"},"devDependencies":{"mocha":"^2.2.0","istanbul":"^0.3.7"},"gitHead":"553fbf0684f4a995f5c5c92575c39466f2a9f78d","_id":"derequire@2.0.2","_shasum":"ec645cd68afc0da6bf917ee7faf836f6e711e501","_from":".","_npmVersion":"2.9.0","_nodeVersion":"2.5.0","_npmUser":{"name":"cwmma","email":"calvin.metcalf@gmail.com"},"maintainers":[{"name":"cwmma","email":"calvin.metcalf@gmail.com"}],"dist":{"shasum":"ec645cd68afc0da6bf917ee7faf836f6e711e501","tarball":"http://registry-npm.ywwl.com/derequire/download/derequire-2.0.2.tgz","integrity":"sha512-2kxqtC/dPMxrKyZJffjMVF46MyQDRPJ4N7rumRyDo9ooQi+29ZAFOYzCaiTQ4GZEp5bKRLPyEPN6TeY8lftIoQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEENdfZmhmuXHCL+8aNmrfRTL1iJzSwiMeNppgCW2h4EAiBIYCV+GM/rt/lys8plwoPXPWr+2s47vPgRUj6DXrEN6w=="}],"size":3028,"noattachment":false,"key":"/derequire/-/derequire-2.0.2.tgz"},"directories":{},"readme":"derequire [![Build Status](https://travis-ci.org/calvinmetcalf/derequire.svg)](https://travis-ci.org/calvinmetcalf/derequire)\n====\n\n```bash\nnpm install derequire\n```\n\n`derequire` can be used either as a JavaScript API or as a CLI.\n\n### JavaScript API\n\n```javascript\nvar derequire = require('derequire');\nvar transformedCode = derequire(code, /*tokenTo=*/'_dereq_', /*tokenFrom=*/'require');\n```\n\n`derequire` takes a string of code and replaces all instances of the `tokenFrom` identifier (defaults to 'require') and replaces them with the `tokenTo` identifier (defaults to '\\_dereq\\_') but only if they are functional arguments or variable declarations and subsequent uses of said argument, then returnes the code.\n\nFor multiple renames at the same time, the following syntax is accepted:\n\n```js\nderequire(code, [\n  {\n    from: 'require',\n    to: '_dereq_'\n  },\n  {\n    from: 'define',\n    to: '_defi_'\n  }\n]);\n```\n\n__Note:__ In order to avoid quite a few headaches the token you're changing from and the token you're changing to need to be the same length.\n\n### Command-line API\n\nThere's a CLI that accepts a file path as an argument (absolute or relative to CWD) or reads from `stdin` if file path is `-` or omitted, and accepts `-f|--from` and `-t|--to` options that correspond to the API `tokenFrom` and `tokenTo` options. Examples:\n\n```bash\nderequire input.js > output.js\nderequire < input.js > output.js\nbrowserify input.js | derequire > output.js\nbrowserify input.js | derequire - > output.js\nderequire input.js --from require --to _gonzo_ > output.js\n```\n","publish_time":1439817236674,"_cnpm_publish_time":1439817236674,"dist-tags":{"latest":"2.1.1"}}