1.1.1 • Published 9 years ago

stricterify v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

NPM Version Build Status

stricterify

Browserify transform to add 'use strict' on the modules that don't have it at the first place. Use with care. Better if not global

Overview

This transform will turn this:

var someFunc = function () {
};
module.exports = someFunc;

Into this:

'use strict';
var someFunc = function () {
};
module.exports = someFunc;

So your code works well once it runs in the browser.

Install

npm i --save-dev stricterify

Usage

var stricterify = require( 'stricterify' ).configure( {
  checkIfSkip: function (file) {
    // use this callback to decide if you want to skip the
    // file from the transform. This is useful if you're
    // requiring legacy modules that are not prepared to be
    // work in strict mode.
    return !!file.match(/skip\.js/);
  }
} );

var b = browserify();
b.add('./my-module');
b.transform( stricterify );

b.bundle().pipe(process.stdout);

Changelog