Socket
Socket
Sign inDemoInstall

package-json-versionify

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    package-json-versionify

Browserify transform to strip package.json of everything but the version


Version published
Maintainers
1
Install size
19.2 kB
Created

Readme

Source

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"}

FAQs

Last updated on 22 Dec 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc