Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-globals

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-globals

A babel plugin that exposes ES6 modules to global variables.

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
61
decreased by-70.81%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-globals

A babel plugin that exposes ES6 modules to global variables.

##Usage This is a babel plugin that converts ES6 modules into global variables. To use it, just add it to your package.json and pass it as a plugin when calling babel:

babel.transform('code', {
  _globalName: 'myGlobal',
  filename: filename,
  plugins: ['globals']
});
// Modules will be available at this.myGlobal.

API

This plugin requires passing two options to the babel config object (besides adding the plugin). They are:

  • _globalName {string} The name of the global variable that the modules should be exported to.
  • filename {string} This is an optional existing babel option, but is required for this plugin, since it uses the file name to decide the name of the keys that will be exported in the global variable.

Keywords

FAQs

Package last updated on 04 Nov 2015

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc