https://github.com/nolanlawson/package-json-versionify
Browserify transform to strip everything from package.json except for the "version" field.
https://github.com/nolanlawson/package-json-versionify
Last synced: 11 days ago
JSON representation
Browserify transform to strip everything from package.json except for the "version" field.
- Host: GitHub
- URL: https://github.com/nolanlawson/package-json-versionify
- Owner: nolanlawson
- License: apache-2.0
- Created: 2015-12-25T19:25:18.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-22T01:46:52.000Z (over 8 years ago)
- Last Synced: 2025-03-28T22:12:30.138Z (29 days ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 12
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
package-json-versionify [](https://travis-ci.org/nolanlawson/package-json-versionify)
=====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:
```js
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.:
```js
{"version":"1.0.0"}
```