{"name":"script-injector","version":"0.1.1","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"},"bugs":{"url":"https://github.com/dlmanning/script-injector/issues"},"_id":"script-injector@0.1.1","dist":{"shasum":"ad34f5289188786d59f502a56dd9fd2d4891fde5","tarball":"http://registry-npm.ywwl.com/script-injector/download/script-injector-0.1.1.tgz","integrity":"sha512-SK+nQW0xpAkOpBb2ODBhU+Mj23Gcc1ltaQZ+pqE0fp3WnYtDllxA9Xg/nMHQ90SpFU/MSYUApTK2x1+OmrLxAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDx3vjgSBLU0DYFWFQWoucW+r2VSgm8zSBkvFOTCNLuigIgDS8VMLCqdmyg0mq6Yi7fVfBt/E055D3+7nhhJG883s8="}],"size":1822,"noattachment":false,"key":"/script-injector/-/script-injector-0.1.1.tgz"},"_from":".","_npmVersion":"1.2.32","_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":1374204480826,"_cnpm_publish_time":1374204480826,"dist-tags":{"latest":"1.0.0"}}