Netherworld's Pretend Minibar

    browserify-requireify

    0.2.0 • Public • Published

    requireify

    Build Status

    A browserify transform for require()-ing non-JS files. Should work with browserify >= 5.x.x.

    It accomplishes this by wrapping the contents of the file in a module.exports = '<contents>' block.

    Installation

    Install via NPM: npm install browserify-requireify

    requireify is already taken :(

    Usage

    var browserify = require('browserify'),
        requireify = require('browserify-requireify');
     
    var b = browserify([ 'my/files/and/stuff.js' ]);
    b.transform(requireify({
        extensions: [ 'txt', 'html', 'css' ]
    }));
     
    b.bundle(function(err, buffer) {
        console.log(buffer.toString());
    });

    Options

    extensions: An array of (case-insensitive) file extensions. requireify won't do anything if the file doesn't have an extension contained in this array.

    Development

    Run tests with npm test

    Install

    npm i browserify-requireify

    DownloadsWeekly Downloads

    6

    Version

    0.2.0

    License

    none

    Last publish

    Collaborators

    • tmont