New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-inline-package-json

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-inline-package-json

Inline references to fields in package.json

2.0.0
latest
Source
npm
Version published
Weekly downloads
18K
20.14%
Maintainers
1
Weekly downloads
 
Created
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

babel-plugin

FAQs

Package last updated on 26 Sep 2016

Did you know?

Socket

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