Socket
Socket
Sign inDemoInstall

babel-plugin-inline-package-json

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-inline-package-json

Inline references to fields in package.json


Version published
Weekly downloads
5.3K
increased by6.66%
Maintainers
1
Install size
3.16 kB
Created
Weekly downloads
 

Readme

Source

babel-plugin-inline-package-json

Babel plugin for inlining values from package.json

Input:

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

Output:

var version = '1.0.0';

The plugin can be used to import any value from a package.json file: primitives, objects, or arrays will all be injected into your compiled source as literal expressions.

Installation

$ npm install babel-plugin-inline-package-json

Usage

Via .babelrc

{
  "plugins": ["inline-package-json"]
}

Via CLI

$ babel --plugins inline-package-json script.js

Via Node API

require('babel-core').transform('code', {
  plugins: ['inline-package-json']
});

Keywords

FAQs

Last updated on 26 Sep 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