trumpetto parse your html.
- Should only be used for good, never for evil
npm install script-injector
How to use
Just pipe a stream of html through script-injector. You can pass in either some stringified code or a function object. What could be easier?
scriptInjector = ;// Then do something like this somewhere elsefs;
script-injector will insert the provided code before your first script tags, or just before
</body> if you don't have any other scripts.