Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

appendify

eneko896MITdeprecated0.1.0

This is not being actively developed nor supported.

Browserify transform to append text to CommonJS modules

browserify, transform, browserify-transform, append

readme

appendify

Browserify transform to append text at the end of CommonJS module files. This makes possible to inject code into modules whose path matches a given glob pattern.

Usage

This transform is designed to be used with the browserify API:

var appendify = require('appendify');

b.transform(appendify, {
  glob: './foo/bar/*.js',
  string: '\nconsole.log("This will be appended to modules matching the glob");'
});

Instead, you could also provide a function which returns the string to inject. The function will receive the file path to the module as parameter:

var appendify = require('appendify');

b.transform(appendify, {
  glob: './foo/bar/*.js',
  string: function(path) {
    return '\n// Module path: ' + path;
  }
});