{
  "_args": [
    [
      {
        "raw": "babel-plugin-transform-es2015-modules-umd@^6.23.0",
        "scope": null,
        "escapedName": "babel-plugin-transform-es2015-modules-umd",
        "name": "babel-plugin-transform-es2015-modules-umd",
        "rawSpec": "^6.23.0",
        "spec": ">=6.23.0 <7.0.0",
        "type": "range"
      },
      "/home/travis/build/lukesargeant/ember-sparkline/node_modules/babel-preset-env"
    ]
  ],
  "_from": "babel-plugin-transform-es2015-modules-umd@>=6.23.0 <7.0.0",
  "_id": "babel-plugin-transform-es2015-modules-umd@6.24.1",
  "_inCache": true,
  "_location": "/babel-plugin-transform-es2015-modules-umd",
  "_nodeVersion": "6.9.0",
  "_npmOperationalInternal": {
    "host": "packages-12-west.internal.npmjs.com",
    "tmp": "tmp/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz_1491578378753_0.8726147976703942"
  },
  "_npmUser": {
    "name": "hzoo",
    "email": "hi@henryzoo.com"
  },
  "_npmVersion": "3.10.10",
  "_phantomChildren": {},
  "_requested": {
    "raw": "babel-plugin-transform-es2015-modules-umd@^6.23.0",
    "scope": null,
    "escapedName": "babel-plugin-transform-es2015-modules-umd",
    "name": "babel-plugin-transform-es2015-modules-umd",
    "rawSpec": "^6.23.0",
    "spec": ">=6.23.0 <7.0.0",
    "type": "range"
  },
  "_requiredBy": [
    "/babel-preset-env"
  ],
  "_resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz",
  "_shasum": "ac997e6285cd18ed6176adb607d602344ad38468",
  "_shrinkwrap": null,
  "_spec": "babel-plugin-transform-es2015-modules-umd@^6.23.0",
  "_where": "/home/travis/build/lukesargeant/ember-sparkline/node_modules/babel-preset-env",
  "dependencies": {
    "babel-plugin-transform-es2015-modules-amd": "^6.24.1",
    "babel-runtime": "^6.22.0",
    "babel-template": "^6.24.1"
  },
  "description": "This plugin transforms ES2015 modules to UMD",
  "devDependencies": {
    "babel-helper-plugin-test-runner": "^6.24.1"
  },
  "directories": {},
  "dist": {
    "shasum": "ac997e6285cd18ed6176adb607d602344ad38468",
    "tarball": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz"
  },
  "keywords": [
    "babel-plugin"
  ],
  "license": "MIT",
  "main": "lib/index.js",
  "maintainers": [
    {
      "name": "amasad",
      "email": "amjad.masad@gmail.com"
    },
    {
      "name": "hzoo",
      "email": "hi@henryzoo.com"
    },
    {
      "name": "jmm",
      "email": "npm-public@jessemccarthy.net"
    },
    {
      "name": "loganfsmyth",
      "email": "loganfsmyth@gmail.com"
    },
    {
      "name": "sebmck",
      "email": "sebmck@gmail.com"
    },
    {
      "name": "thejameskyle",
      "email": "me@thejameskyle.com"
    }
  ],
  "name": "babel-plugin-transform-es2015-modules-umd",
  "optionalDependencies": {},
  "readme": "# babel-plugin-transform-es2015-modules-umd\n\n> This plugin transforms ES2015 modules to [Universal Module Definition (UMD)](https://github.com/umdjs/umd).\n\n## Example\n\n**In**\n\n```javascript\nexport default 42;\n```\n\n**Out**\n\n```javascript\n(function (global, factory) {\n  if (typeof define === \"function\" && define.amd) {\n    define([\"exports\"], factory);\n  } else if (typeof exports !== \"undefined\") {\n    factory(exports);\n  } else {\n    var mod = {\n      exports: {}\n    };\n    factory(mod.exports);\n    global.actual = mod.exports;\n  }\n})(this, function (exports) {\n  \"use strict\";\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n\n  exports.default = 42;\n});\n```\n\n## Installation\n\n```sh\nnpm install --save-dev babel-plugin-transform-es2015-modules-umd\n```\n\n## Usage\n\n### Via `.babelrc` (Recommended)\n\n**.babelrc**\n\n```json\n{\n  \"plugins\": [\"transform-es2015-modules-umd\"]\n}\n```\n\nYou can also override the names of particular libraries when this module is\nrunning in the browser.  For example the `es6-promise` library exposes itself\nas `global.Promise` rather than `global.es6Promise`. This can be accommodated by:\n\n```json\n{\n  \"plugins\": [\n    [\"transform-es2015-modules-umd\", {\n      \"globals\": {\n        \"es6-promise\": \"Promise\"\n      }\n    }]\n  ]\n}\n```\n\n#### Default semantics\n\nThere are a few things to note about the default semantics.\n\n_First_, this transform uses the\n[basename](https://en.wikipedia.org/wiki/Basename) of each import to generate\nthe global names in the UMD output. This means that if you're importing\nmultiple modules with the same basename, like:\n\n```js\nimport fooBar1 from \"foo-bar\";\nimport fooBar2 from \"./mylib/foo-bar\";\n```\n\nit will transpile into two references to the same browser global:\n\n```js\nfactory(global.fooBar, global.fooBar);\n```\n\nIf you set the plugin options to:\n\n```json\n{\n  \"globals\": {\n    \"foo-bar\": \"fooBAR\",\n    \"./mylib/foo-bar\": \"mylib.fooBar\"\n  }\n}\n```\n\nit will still transpile both to one browser global:\n\n```js\nfactory(global.fooBAR, global.fooBAR);\n```\n\nbecause again the transform is only using the basename of the import.\n\n_Second_, the specified override will still be passed to the `toIdentifier`\nfunction in [babel-types/src/converters](https://github.com/babel/babel/blob/master/packages/babel-types/src/converters.js).\nThis means that if you specify an override as a member expression like:\n\n```json\n{\n  \"globals\": {\n    \"fizzbuzz\": \"fizz.buzz\"\n  }\n}\n```\n\nthis will _not_ transpile to `factory(global.fizz.buzz)`. Instead, it will\ntranspile to `factory(global.fizzBuzz)` based on the logic in `toIdentifier`.\n\n_Third_, you cannot override the exported global name.\n\n#### More flexible semantics with `exactGlobals: true`\n\nAll of these behaviors can limit the flexibility of the `globals` map. To\nremove these limitations, you can set the `exactGlobals` option to `true`.\nDoing this instructs the plugin to:\n\n1. always use the full import string instead of the basename when generating\nthe global names\n2. skip passing `globals` overrides to the `toIdentifier` function. Instead,\nthey are used exactly as written, so you will get errors if you do not use\nvalid identifiers or valid uncomputed (dot) member expressions.\n3. allow the exported global name to be overridden via the `globals` map. Any\noverride must again be a valid identifier or valid member expression.\n\nThus, if you set `exactGlobals` to `true` and do not pass any overrides, the\nfirst example of:\n\n```js\nimport fooBar1 from \"foo-bar\";\nimport fooBar2 from \"./mylib/foo-bar\";\n```\n\nwill transpile to:\n\n```js\nfactory(global.fooBar, global.mylibFooBar);\n```\n\nAnd if you set the plugin options to:\n\n```json\n{\n  \"globals\": {\n    \"foo-bar\": \"fooBAR\",\n    \"./mylib/foo-bar\": \"mylib.fooBar\"\n  },\n  \"exactGlobals\": true\n}\n```\n\nthen it'll transpile to:\n\n```js\nfactory(global.fooBAR, global.mylib.fooBar)\n```\n\nFinally, with the plugin options set to:\n\n```json\n{\n  \"plugins\": [\n    \"external-helpers\",\n    [\"transform-es2015-modules-umd\", {\n      \"globals\": {\n        \"my/custom/module/name\": \"My.Custom.Module.Name\"\n      },\n      \"exactGlobals\": true\n    }]\n  ],\n  \"moduleId\": \"my/custom/module/name\"\n}\n```\n\nit will transpile to:\n\n```js\nfactory(mod.exports);\nglobal.My = global.My || {};\nglobal.My.Custom = global.My.Custom || {};\nglobal.My.Custom.Module = global.My.Custom.Module || {};\nglobal.My.Custom.Module.Name = mod.exports;\n```\n\n### Via CLI\n\n```sh\nbabel --plugins transform-es2015-modules-umd script.js\n```\n\n### Via Node API\n\n```javascript\nrequire(\"babel-core\").transform(\"code\", {\n  plugins: [\"transform-es2015-modules-umd\"]\n});\n```\n",
  "readmeFilename": "README.md",
  "repository": {
    "type": "git",
    "url": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-es2015-modules-umd"
  },
  "scripts": {},
  "version": "6.24.1"
}
