-
viralify(root, transform, front, cb)
-
Injects the given transform(s) into the
browserify.transformfield of allpackage.jsons at and below the givenroot.If the transform(s) were contained in the
package.jsonalready, no changes are made and no writes performed. This means that all viralify runs succeeding the first one will be much faster than the first.Parameters:
Name Type Argument Description rootString of the package
transformArray.<String> one or more transforms to be added to the transform field
frontBoolean <optional>
if set transforms are added to the front of the transform field so they run first
cbfunction called when the transform injection is complete
Package Exports
- viralify
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (viralify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
viralify 
Injects one or more browserify transforms into all dependencies of a package recursively.
viralify . -t browserify-swapvar viralify = require('viralify');
viralify(root, 'browserify-swap', function (err) {
if (err) return console.error(err);
// package.json's found in root and below now have 'browserify-swap' added
// to the end of their 'browserify.transform' field
})Installation
npm install viralifyUsage
viralify <path> <options>
Inject browserify transform(s) into the package.json files of all packages at and below the given path.
OPTIONS:
-t, --transform transform(s) to inject
-f, --front if set, the transform(s) are injected in the front of the transform field so they run first
EXAMPLES:
Inject 'browserify-swap' transform for package in current directory and all its dependencies
viralify . -t browserify-swap
Inject 'envify' and 'es6ify' transforms in front for all dependencies found in ./node_modules
viralify ./node_modules --transform envify --transform es6ify --frontAPI
generated with docme
viralify.sync(root, transform, front)
Same as viralify but performed synchronously.
License
MIT