{
  "name": "es6-module-transpiler-rhengles",
  "version": "0.3.0",
  "description": "es6-module-transpiler is an experimental compiler that allows you to write your JavaScript or CoffeeScript using a subset of the current ES6 module syntax, and compile it into AMD, CommonJS, and globals styles.",
  "homepage_COMMENT": "http://square.github.com/es6-module-transpiler",
  "keywords": [
    "es6",
    "module",
    "transpile",
    "amd",
    "commonjs"
  ],
  "bugs": {
    "url": "https://github.com/rhengles/es6-module-transpiler/issues"
  },
  "preferGlobal": true,
  "bin": {
    "compile-modules": "./bin/compile-modules"
  },
  "directories": {
    "lib": "./lib"
  },
  "main": "./lib/index",
  "repository": {
    "type": "git",
    "url": "https://github.com/rhengles/es6-module-transpiler.git"
  },
  "dependencies": {
    "coffee-script": "~1.3.3",
    "optimist": "~0.3.5"
  },
  "scripts": {
    "test": "grunt"
  },
  "devDependencies_COMMENT": {
    "comment": "These modules should be installed globally, we don't want to repeat them inside this package if you run 'npm install'.",
    "grunt-cli": "~0.1.6"
  },
  "devDependencies": {
    "gluejs": "~0.2.2",
    "uglify-js": "~2.2.4",
    "grunt": "~0.4.1",
    "jasmine-node": "~1.8.0",
    "grunt-jasmine-node": "~0.1.0",
    "grunt-contrib-uglify": "~0.2.2",
    "grunt-contrib-gluejs": "0.0.3"
  },
  "contributors": [
    {
      "name": "Brian Donovan",
      "email": "donovan@squareup.com"
    },
    {
      "name": "Rafael Hengles",
      "email": "rhengles@gmail.com"
    }
  ],
  "readme": "# ES6 Module Transpiler\n\nES6 Module Transpiler is an experimental compiler that allows you to write\nyour JavaScript/CoffeeScript using a subset of the current ES6 module syntax,\nand compile it into AMD or CommonJS modules.\n\n**WARNING: The ES6 module syntax is still undergoing a lot of churn,\nand will definitely still change before final approval.**\n\n**ES6 Module Transpiler will track ES6 syntax, and not attempt to\nmaintain backwards compatibility with syntax that ultimately did\nnot succeed as part of ES6.**\n\nThis compiler provides a way to experiment with ES6 syntax in real\nworld scenarios to see how the syntax holds up. It also provides a\nnicer, more declarative way to write AMD (or CommonJS) modules.\n\nSee the [CHANGELOG](./CHANGELOG.md) for the latest updates.\n\n## Usage\n\n### Executable\n\nThe easiest way to use the transpiler is via the command line:\n\n```\n$ npm install -g https://git.squareup.com/javascript/es6-module-transpiler\n$ compile-modules foo.js --to compiled\n```\n\nHere is the basic usage:\n\n```\ncompile-modules FILE [FILE…] --to OUTPUT [--type=TYPE]\n  [--anonymous] [--module-name=NAME]\n  [--global=GLOBAL] [--imports=IMPORTS]\n\nFILE\n  An input file relative to the current directory to process.\n\nOUTPUT\n  An output directory relative to the current directory.  If it does not exist,\n  it will be created.\n\nTYPE\n  One of `amd` (for AMD output), `cjs` (for CommonJS output).\n\nANONYMOUS\n  If you use the --anonymous flag with the AMD type, the transpiler will output\n  a module with no name.\n\nNAME\n  You can supply a name to use as the module name.  By default, the transpiler\n  will use the name of the file (without the ending `.js`/`.coffee`) as the\n  module name.  You may not use this option if you provided multiple FILEs.\n\nGLOBAL\n  This option is only supported when the type is `globals`. By default, the\n  `globals` option will attach all of the exports to `window`. This option will\n  attach the exports to a single named variable on `window` instead.\n\nIMPORTS\n  This option is only supported when the type is\n  `globals`. It is a hash option. If your module\n  includes imports, you must use this option to\n  map the import names onto globals. For example,\n  `--imports ember:Ember underscore:_`\n```\n\n### Library\n\nYou can also use the transpiler as a library:\n\n```javascript\nvar Compiler = require(\"es6-module-transpiler\").Compiler;\n\nvar compiler = new Compiler(string, name);\ncompiler.toAMD(); // AMD output\n```\n\nIf you want to emit globals output, and your module has imports, you must\nsupply an `imports` hash. You can also use the `global` option to specify that\nexports should be added to a single global instead of `window`.\n\n```javascript\nvar Compiler = require(\"es6-module-transpiler\").Compiler;\n\nvar imports = { underscore: \"_\", ember: \"Ember\" };\nvar options = { imports: imports, global: \"RSVP\" };\n\nvar compiler = new Compiler(string, name, options);\ncompiler.toGlobals() // window global output\n```\n\nThe `string` parameter is a string of JavaScript written using the declarative\nmodule syntax.\n\nThe `name` parameter is an optional name that should be used as the name of the\nmodule if appropriate (for AMD, this maps onto the first parameter to the\n`define` function).\n\n## Support Syntax\n\nAgain, this syntax is in flux and is closely tracking the module work being\ndone by TC39.\n\n### Exports\n\nThere are two ways to do exports.\n\n```javascript\nvar get = function(obj, key) {\n  return obj[key];\n};\n\nvar set = function(obj, key, value) {\n  obj[key] = value;\n  return obj;\n};\n\nexport { get, set };\n```\n\nYou can also write this form as:\n\n```javascript\nvar get = function(obj, key) {\n  return obj[key];\n};\n\nexport get;\n\nvar set = function(obj, key, value) {\n  obj[key] = value;\n  return obj;\n};\n\nexport set;\n```\n\nBoth of these export two variables: `get` and `set`. Below, in the import\nsection, you will see how to use these exports in another module.\n\nYou can also export a single variable *as the module itself*:\n\n```javascript\nvar jQuery = function() {};\n\njQuery.prototype = {\n  // ...\n};\n\nexport default jQuery;\n```\n\n### Imports\n\nIf you want to import variables exported individually from another module, you\nuse this syntax:\n\n```javascript\nimport { get, set } from \"ember\";\n```\n\nTo import a module that set its export using `export default`, you use this syntax:\n\n```javascript\nimport jQuery from \"jquery\";\n```\n\nAs you can see, the import and export syntaxes are symmetric.\n\n## AMD Compiled Output\n\n### Individual Exports\n\nThis input (ember.js):\n\n```javascript\nvar get = function(obj, key) {\n  return obj[key];\n};\n\nvar set = function(obj, key, value) {\n  obj[key] = value;\n  return obj;\n};\n\nexport { get, set };\n```\n\nwill compile into this AMD output:\n\n```javascript\ndefine(\"ember\",\n  [\"exports\"],\n  function(__exports__) {\n    \"use strict\";\n    var get = function(obj, key) {\n      return obj[key];\n    };\n\n    var set = function(obj, key, value) {\n      obj[key] = value;\n      return obj;\n    };\n\n    __exports__.get = get;\n    __exports__.set = set;\n  });\n```\n\nThe output is the same whether you use the single-line export (`export { get,\nset }`) or multiple export lines, as above.\n\n### A Single Export\n\nThis input:\n\n```javascript\nvar jQuery = function() {};\n\njQuery.prototype = {\n  // ...\n};\n\nexport default jQuery;\n```\n\nwill compile into this AMD output:\n\n```javascript\ndefine(\"ember\",\n  [],\n  function() {\n    \"use strict\";\n    var jQuery = function() {};\n\n    jQuery.prototype = {\n      // ...\n    };\n\n    return jQuery;\n  });\n```\n\n### Individual Imports\n\nThis input:\n\n```javascript\nimport { get, set } from \"ember\";\n```\n\nwill compile into this AMD output:\n\n```javascript\ndefine(\"app\",\n  [\"ember\"],\n  function(__dependency1__) {\n    \"use strict\";\n    var get = __dependency1__.get;\n    var set = __dependency1__.set;\n  });\n```\n\n### Importing a Whole Module (`import as`)\n\nThis input:\n\n```javascript\nimport jQuery from \"jquery\";\n```\n\nwill compile into this AMD output:\n\n```javascript\ndefine(\"app\",\n  [\"jquery\"],\n  function(jQuery) {\n    \"use strict\";\n  });\n```\n\n## Using with Node.js\n\nYou can use this library to pre-transpile your browser code or your node packages,\nbut when developing a node package this can be painful. To make testing your\npackages easier you can configure es6-module-transpiler to auto-transpile your\nJavaScript or CoffeeScript modules on the fly:\n\n```javascript\n// mymodule.js\nimport jQuery from \"jquery\";\nexport jQuery;\n\n// bootstrap.js\nrequire(\"es6-module-transpiler/require_support\").enable();\nvar jQuery = require(\"./mymodule\").jQuery;\n\n// …\n```\n\n## Using with Grunt\n\nYou can install the\n[grunt-es6-module-transpiler](http://github.com/joefiorini/grunt-es6-module-transpiler)\nplugin to run the transpiler as part of your [Grunt.js](http://gruntjs.com)\nbuild task. See the README on the plugin's Github page for more information.\n\n## Installation\n\nAdd this project to your application's package.json by running this:\n\n    $ npm install --save es6-module-transpiler\n\nOr install it globally:\n\n    $ sudo npm install -g es6-module-transpiler\n\n## Acknowledgements\n\nThanks to Yehuda Katz for\n[js_module_transpiler](https://github.com/wycats/js_module_transpiler), the\nlibrary on which this one is based. Thanks to Dave Herman for his work on ES6\nmodules. Thanks to Erik Bryn for providing the initial push to write this\nlibrary. And finally thanks to the JavaScript community at Square for helping\nto write and release this library.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\nAny contributors to the master es6-module-transpiler repository must sign the\n[Individual Contributor License Agreement (CLA)][cla].  It's a short form that\ncovers our bases and makes sure you're eligible to contribute.\n\n[cla]: https://spreadsheets.google.com/spreadsheet/viewform?formkey=dDViT2xzUHAwRkI3X3k5Z0lQM091OGc6MQ&ndplr=1\n\nWhen you have a change you'd like to see in the master repository, [send a pull\nrequest](https://github.com/square/es6-module-transpiler/pulls). Before we merge\nyour request, we'll make sure you're in the list of people who have signed a\nCLA.\n\nThanks, and enjoy living in the ES6 future!\n",
  "readmeFilename": "README.md",
  "_id": "es6-module-transpiler@0.2.0",
  "dist": {
  },
  "_from": "es6-module-transpiler@~0.2.0",
  "_resolved": "https://registry.npmjs.org/es6-module-transpiler/-/es6-module-transpiler-0.2.0.tgz"
}
