{"name":"script-injector","version":"0.1.5","description":"Inject inline javascript into an HTML stream.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/dlmanning/script-injector.git"},"keywords":["html","stream","script","inject","injector","injection","parser"],"author":{"name":"David Manning"},"license":"MIT","dependencies":{"trumpet":"~1.5.0","through":"~2.3.4","duplexer":"~0.1.1"},"devDependencies":{"tape":"~1.1.0","concat-stream":"~1.0.1"},"bugs":{"url":"https://github.com/dlmanning/script-injector/issues"},"_id":"script-injector@0.1.5","dist":{"shasum":"d14b20c53b038f3cfbb401814fe305c4564268b6","tarball":"http://registry-npm.ywwl.com/script-injector/download/script-injector-0.1.5.tgz","integrity":"sha512-RxmGMbyMvuSDw0O5V1MT8s1tptCcMqtQa8fk3kY0Gc4vFy81v5dSB42KqRhjuzIFjWMow8KJkNWekmpiN3nWSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG0ewGuYh4KMHUTNmKg4rRxDZMujAj+iy+MM5p65EPivAiEAu2eqYDlzlrwnwOh6TLV/lM7hHPS/EIayUIeXwYksbQU="}],"size":2292,"noattachment":false,"key":"/script-injector/-/script-injector-0.1.5.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"dlmanning","email":"dlmanning@me.com"},"maintainers":[{"name":"dlmanning","email":"dlmanning@me.com"}],"directories":{},"readme":"#script-injector\n\n1. provides a through stream that allows you to inject inline javascript into an html text stream.\n2. Uses [`trumpet`](https://github.com/substack/node-trumpet) to parse your html.\n3. Should only be used for good, never for evil\n\n## Installation\n\n`npm install script-injector`\n\n\n## How to use\n\nJust pipe a stream of html through script-injector. You can pass in either some stringified code or a function object. What could be easier?\n\n```javascript\nscriptInjector = require('script-injector');\n\n// Then do something like this somewhere else\n\nfs.createReadStream('anHTMLFile')\n  .pipe(scriptInjector(aFunction))\n  .pipe(someOtherPlace);\n```\n\n`script-injector` will insert the provided code *before* your first script tags, or just before `</body>` if you don't have any other scripts.","publish_time":1379574220050,"_cnpm_publish_time":1379574220050,"dist-tags":{"latest":"1.0.0"}}