Skip to content

Browserify transform to strip everything from package.json except for the "version" field.

License

Notifications You must be signed in to change notification settings

nolanlawson/package-json-versionify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

package-json-versionify Build Status

Browserify transform to strip everything from package.json except for the "version" field.

Installation

npm install --save package-json-versionify

Description

Say you want to ship a library, and do something like:

MyLibrary.version = require('./package.json').version;

Unfortunately, if you do this, then your entire package.json will be included in the output Browserify bundle, which will increase your bundle size. Bummer!

However, if you use this transform, then it will remove everything from package.json except for the "version" field. So when you require('./package.json'), you get something much more compact, e.g.:

{"version":"1.0.0"}

About

Browserify transform to strip everything from package.json except for the "version" field.

Resources

License

Stars

Watchers

Forks

Packages

No packages published