{"_id":"es6-comprehensions","_rev":"33-11887ec978668e17a2eb2e8c1034d30e","name":"es6-comprehensions","description":"Transforms ES6 Array Comprehensions to ES5 compliant equivalent.","dist-tags":{"latest":"0.3.1"},"versions":{"0.1.0":{"name":"es6-comprehensions","version":"0.1.0","description":"Array comprehensions compiled to ES5.","main":"index.js","scripts":{"test":"mocha --recursive --reporter spec --timeout 500 test"},"dependencies":{"esprima":"git://github.com/ariya/esprima.git#harmony","recast":"~0.4.24","through":"~2.3.4"},"devDependencies":{"mocha":"~1.14.0","expect.js":"~0.2.0"},"keywords":["array","list","comprehension","es6","es5","parser","ast"],"repository":{"type":"git","url":"https://github.com/dreame4/es6-comprehensions.git"},"author":{"name":"Adam Babik"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/dreame4/es6-comprehensions/issues"},"homepage":"https://github.com/dreame4/es6-comprehensions","_id":"es6-comprehensions@0.1.0","dist":{"shasum":"724728f8e660163ec4485a7d5d7da7ebf1c6f4d2","tarball":"https://registry.npmjs.org/es6-comprehensions/-/es6-comprehensions-0.1.0.tgz","integrity":"sha512-aR75JX84JUo2Skon6BVK0ueeYS1PLDF/FJgV3/hBrvCxNp6/2xbeWHU9Wy/S0WXYVXO84o93gkPH2S4M7XhhzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDawVIIQ3VR4EPXjFAfVR2yIRt4Lge0roQ2re8U2rClgIhANthN/ISVFPEd6UGjRnHGwIVO9G8XHRgqEoAQ9/w82VY"}]},"_from":".","_npmVersion":"1.3.15","_npmUser":{"name":"dreame4","email":"a.babik@designfortress.com"},"maintainers":[{"name":"dreame4","email":"a.babik@designfortress.com"}]},"0.1.1":{"name":"es6-comprehensions","version":"0.1.1","description":"Array comprehensions compiled to ES5.","main":"index.js","scripts":{"test":"mocha --recursive --reporter spec --timeout 500 test"},"dependencies":{"esprima":"git://github.com/ariya/esprima.git#harmony","recast":"~0.4.24","through":"~2.3.4"},"devDependencies":{"mocha":"~1.14.0","expect.js":"~0.2.0"},"keywords":["array","list","comprehension","es6","es5","parser","ast"],"repository":{"type":"git","url":"https://github.com/dreame4/es6-comprehensions.git"},"author":{"name":"Adam Babik"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/dreame4/es6-comprehensions/issues"},"homepage":"https://github.com/dreame4/es6-comprehensions","_id":"es6-comprehensions@0.1.1","dist":{"shasum":"cc88d67e9ed1cf89f918326f93188a32eadf7940","tarball":"https://registry.npmjs.org/es6-comprehensions/-/es6-comprehensions-0.1.1.tgz","integrity":"sha512-LsG6qGCSicFb5stL88F2E1ew48Cg/7oLpM1pC7kX0x8kFVQctfyNt67yKX8e4xE1l8o5mRvCYeJRc02L0hQwlQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBv+RPGCJHWh2h7eDoflH0ROc+gVsrvy8z+7QrpqOn3yAiADy6S8RkGTBh2EquobDpv3TDsBBPd8NoXL7i6esGY0+A=="}]},"_from":".","_npmVersion":"1.3.15","_npmUser":{"name":"dreame4","email":"a.babik@designfortress.com"},"maintainers":[{"name":"dreame4","email":"a.babik@designfortress.com"}]},"0.1.2":{"name":"es6-comprehensions","version":"0.1.2","description":"Array comprehensions compiled to ES5.","main":"index.js","bin":{"es6-comprehensions":"bin/es6-comprehensions"},"scripts":{"test":"mocha --recursive --reporter spec --timeout 500 test"},"dependencies":{"esprima":"git://github.com/ariya/esprima.git#harmony","recast":"~0.4.24","through":"~2.3.4"},"devDependencies":{"mocha":"~1.14.0","expect.js":"~0.2.0"},"keywords":["array","list","comprehension","es6","es5","parser","ast"],"repository":{"type":"git","url":"https://github.com/dreame4/es6-comprehensions.git"},"author":{"name":"Adam Babik"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/dreame4/es6-comprehensions/issues"},"homepage":"https://github.com/dreame4/es6-comprehensions","_id":"es6-comprehensions@0.1.2","dist":{"shasum":"c6ce8b71208a65897a891cfd94fd8648005ea63f","tarball":"https://registry.npmjs.org/es6-comprehensions/-/es6-comprehensions-0.1.2.tgz","integrity":"sha512-HgwbPiAFeWl3uu8gCwdIJK72aeBlKD6y6jL3U5ADapfpwnssWASFOVKV1U8FqybaE4rnz5jAH3+9N94+oddPDQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCjuF2dPdPcKNFvCF0mBNEKx0fpM0DpVU6g7IRVShLRgIgUVXe5Jomhuh0dFpRM1TGUpuLkgYkfduFV1YPJa4skos="}]},"_from":".","_npmVersion":"1.3.15","_npmUser":{"name":"dreame4","email":"a.babik@designfortress.com"},"maintainers":[{"name":"dreame4","email":"a.babik@designfortress.com"}]},"0.1.3":{"name":"es6-comprehensions","version":"0.1.3","description":"Array comprehensions compiled to ES5.","main":"index.js","bin":{"es6-comprehensions":"bin/es6-comprehensions"},"scripts":{"test":"mocha --recursive --reporter spec --timeout 500 test"},"dependencies":{"esprima":"git://github.com/ariya/esprima.git#harmony","recast":"~0.4.24","through":"~2.3.4"},"devDependencies":{"mocha":"~1.14.0","expect.js":"~0.2.0"},"keywords":["array","list","comprehension","es6","es5","parser","ast"],"repository":{"type":"git","url":"https://github.com/dreame4/es6-comprehensions.git"},"author":{"name":"Adam Babik"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/dreame4/es6-comprehensions/issues"},"homepage":"https://github.com/dreame4/es6-comprehensions","_id":"es6-comprehensions@0.1.3","dist":{"shasum":"3b986a319bb61ad4bdc927664801b9ec3469d91f","tarball":"https://registry.npmjs.org/es6-comprehensions/-/es6-comprehensions-0.1.3.tgz","integrity":"sha512-wovj1xJaC4Srga/xfcfLMcmGS+GmoNkKMwMk8v7ds6zlZOruJf8oXbmKi3B9H2cOEWrJkklhnr4Pvi8+Jiy8kA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGkZVNfQ/8fqttleT9Y9FWY16NbB1c9Q3bf16dWUo0T6AiAh69jbUqk2Fv7nIZVAzXnJzzNcW8eYdJHnBPM6iuM+JA=="}]},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"dreame4","email":"a.babik@designfortress.com"},"maintainers":[{"name":"dreame4","email":"a.babik@designfortress.com"}]},"0.2.0":{"name":"es6-comprehensions","version":"0.2.0","description":"Transforms ES6 Array Comprehensions to ES5 compliant equivalent.","main":"src/index.js","bin":{"es6-comprehensions":"bin/es6-comprehensions"},"scripts":{"test":"mocha --recursive --reporter spec test"},"dependencies":{"esprima":"git://github.com/ariya/esprima.git#harmony","through":"~2.3.4","recast":"~0.5.16","yargs":"~1.2.1","through2":"~0.4.1"},"devDependencies":{"mocha":"~1.18.0","expect.js":"~0.3.1"},"keywords":["array","list","comprehension","es6","es5","parser","ast"],"repository":{"type":"git","url":"https://github.com/dreame4/es6-comprehensions.git"},"author":{"name":"Adam Babik"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/dreame4/es6-comprehensions/issues"},"homepage":"https://github.com/dreame4/es6-comprehensions","_id":"es6-comprehensions@0.2.0","dist":{"shasum":"af6e9956d7cafb9f87068d02346298ef62b0cca2","tarball":"https://registry.npmjs.org/es6-comprehensions/-/es6-comprehensions-0.2.0.tgz","integrity":"sha512-RuUbrVWcMneCTmqrl/NFEMT/4C1nIWhZ8Wh0kx3jkA7gUvi2BRlwBt7afCYfsF5UoirspSl4AFn2RixLYfZaaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxm0YvOcY9WsLNrLh0qeQp6/AbGTK180cnhvz6zrorQgIhAKU8BUUoMmlGVIX1TBPv3cgOSvQ619Z3oIVirYqYGbrq"}]},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"dreame4","email":"a.babik@designfortress.com"},"maintainers":[{"name":"dreame4","email":"a.babik@designfortress.com"}]},"0.2.1":{"name":"es6-comprehensions","version":"0.2.1","description":"Transforms ES6 Array Comprehensions to ES5 compliant equivalent.","main":"src/index.js","bin":{"es6-comprehensions":"bin/es6-comprehensions"},"scripts":{"test":"mocha --recursive --reporter spec test"},"dependencies":{"esprima":"git://github.com/ariya/esprima.git#harmony","through":"~2.3.4","recast":"~0.5.16","yargs":"~1.2.1","through2":"~0.4.1"},"devDependencies":{"mocha":"~1.18.0","expect.js":"~0.3.1"},"keywords":["array","list","comprehension","es6","es5","parser","ast"],"repository":{"type":"git","url":"https://github.com/dreame4/es6-comprehensions.git"},"author":{"name":"Adam Babik"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/dreame4/es6-comprehensions/issues"},"homepage":"https://github.com/dreame4/es6-comprehensions","_id":"es6-comprehensions@0.2.1","dist":{"shasum":"f72f2d0f9208cbfd7c000dbf753e0358f0415e94","tarball":"https://registry.npmjs.org/es6-comprehensions/-/es6-comprehensions-0.2.1.tgz","integrity":"sha512-PktWwAXzxoQ6rcIEaEwvjcVOTHFZh8jSI12/vUbtA2fjYwu4jIn7QxFKyqtWLcHJz2O2xlVy5XZiXkhiXM/zTQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBve0cI10R/P1rysJYL3A/I12uxjFeS1Ni43cLvrMI78AiEAkggNHscCXvKlAUz3k1a+Fy5fXAjdkVfb7Da2LdWJaZc="}]},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"dreame4","email":"a.babik@designfortress.com"},"maintainers":[{"name":"dreame4","email":"a.babik@designfortress.com"}]},"0.2.2":{"name":"es6-comprehensions","version":"0.2.2","description":"Transforms ES6 Array Comprehensions to ES5 compliant equivalent.","main":"src/index.js","bin":{"es6-comprehensions":"bin/es6-comprehensions"},"scripts":{"test":"mocha --recursive --reporter spec --bail ./test"},"dependencies":{"esprima":"git://github.com/ariya/esprima.git#harmony","through":"~2.3.4","recast":"~0.5.16","yargs":"~1.2.1","through2":"~0.4.1","ast-util":"0.0.6"},"devDependencies":{"mocha":"~1.18.0","expect.js":"~0.3.1"},"keywords":["array","list","comprehension","es6","es5","parser","ast"],"repository":{"type":"git","url":"https://github.com/dreame4/es6-comprehensions.git"},"author":{"name":"Adam Babik"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/dreame4/es6-comprehensions/issues"},"homepage":"https://github.com/dreame4/es6-comprehensions","_id":"es6-comprehensions@0.2.2","dist":{"shasum":"0fc8a1584d8da6bbda9db73a0b8c3bdc289666d2","tarball":"https://registry.npmjs.org/es6-comprehensions/-/es6-comprehensions-0.2.2.tgz","integrity":"sha512-ZbkriETcqZ89GhjKVkDGRGVNa1NX3TXFjfEFItatM7GclajiMDA4pGGJjwdzCh4HnsxwYz4d4Wii3mzmePPe9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkmKJZvtRvYjrt9zZEEmEZt6UShH4pYV+qUNqXGby+bQIgfECVwd0BQZUTKAKzhK9vBmfA1vJyFelHCSGbb+kfiLU="}]},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"dreame4","email":"a.babik@designfortress.com"},"maintainers":[{"name":"dreame4","email":"a.babik@designfortress.com"}]},"0.2.3":{"name":"es6-comprehensions","version":"0.2.3","description":"Transforms ES6 Array Comprehensions to ES5 compliant equivalent.","main":"src/index.js","bin":{"es6-comprehensions":"bin/es6-comprehensions"},"scripts":{"test":"mocha --recursive --reporter spec --bail ./test"},"dependencies":{"esprima":"git://github.com/ariya/esprima.git#harmony","through":"~2.3.4","recast":"~0.5.16","yargs":"~1.2.1","through2":"~0.4.1","ast-util":"0.0.6"},"devDependencies":{"mocha":"~1.18.0","expect.js":"~0.3.1"},"keywords":["array","list","comprehension","es6","es5","parser","ast"],"repository":{"type":"git","url":"https://github.com/dreame4/es6-comprehensions.git"},"author":{"name":"Adam Babik"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/dreame4/es6-comprehensions/issues"},"homepage":"https://github.com/dreame4/es6-comprehensions","_id":"es6-comprehensions@0.2.3","dist":{"shasum":"3113e150f2223f8ac266cb1c7d9b58b319b79b12","tarball":"https://registry.npmjs.org/es6-comprehensions/-/es6-comprehensions-0.2.3.tgz","integrity":"sha512-bP6Ws98nZhXT3MT9M3pYPUgsbvwFsYamvS5GWpMhgnasvYGCY1Yl0CJJPiZCrBG05OJ7iwuXN7dF93zHTbNuzw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICt1i0W39JsDDD7iTZQaEalgGpwsHCWYqp1QrBA/f/3wAiBF1bCEczp5KZ6Yyj6fxwCTlCvjq68BukfoF+9wJcz8QA=="}]},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"dreame4","email":"a.babik@designfortress.com"},"maintainers":[{"name":"dreame4","email":"a.babik@designfortress.com"}]},"0.3.0":{"name":"es6-comprehensions","version":"0.3.0","description":"Transforms ES6 Array Comprehensions to ES5 compliant equivalent.","main":"src/index.js","bin":{"es6-comprehensions":"bin/es6-comprehensions"},"scripts":{"test":"mocha --recursive --reporter spec --bail ./test"},"dependencies":{"esprima":"git://github.com/ariya/esprima.git#harmony","through":"~2.3.4","recast":"~0.5.16","yargs":"~1.2.1","through2":"~0.4.1","ast-util":"0.0.6","es6-for-of":"0.2.3"},"devDependencies":{"mocha":"~1.18.0","expect.js":"~0.3.1"},"keywords":["array","list","comprehension","es6","es5","parser","ast"],"repository":{"type":"git","url":"https://github.com/dreame4/es6-comprehensions.git"},"author":{"name":"Adam Babik"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/dreame4/es6-comprehensions/issues"},"homepage":"https://github.com/dreame4/es6-comprehensions","_id":"es6-comprehensions@0.3.0","dist":{"shasum":"70b058ffb5f7ee26c25f999ebf935a89304d4ac0","tarball":"https://registry.npmjs.org/es6-comprehensions/-/es6-comprehensions-0.3.0.tgz","integrity":"sha512-uDF5DwkbPCRVXTK5C4ZZVGAPKtZ009MS/wu4Xy8xJ9OCAC7JOI+yEfmv/tJzxqmjL3mgU4etPsjsZ1V3Y1jmQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDxWoI8+YXArxV3P+Jp5p05XJJplu87VdpTIzzT8fNPaAiEAzMVFEKuhspDk/03ZuxKAI/t4fLUYCwl19PUZBj7vW3M="}]},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"dreame4","email":"a.babik@designfortress.com"},"maintainers":[{"name":"dreame4","email":"a.babik@designfortress.com"}]},"0.3.1":{"name":"es6-comprehensions","version":"0.3.1","description":"Transforms ES6 Array Comprehensions to ES5 compliant equivalent.","main":"src/index.js","bin":{"es6-comprehensions":"bin/es6-comprehensions"},"scripts":{"test":"mocha --recursive --reporter spec --bail ./test"},"dependencies":{"esprima-fb":"^6001.1001.0-dev-harmony-fb","through":"~2.3.4","recast":"~0.5.16","yargs":"~1.2.1","through2":"~0.4.1","ast-util":"0.0.6","es6-for-of":"0.2.3"},"devDependencies":{"mocha":"~1.18.0","expect.js":"~0.3.1"},"keywords":["array","list","comprehension","es6","es5","parser","ast"],"repository":{"type":"git","url":"https://github.com/dreame4/es6-comprehensions.git"},"author":{"name":"Adam Babik"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/dreame4/es6-comprehensions/issues"},"homepage":"https://github.com/dreame4/es6-comprehensions","_id":"es6-comprehensions@0.3.1","_shasum":"3dd9dff900835664da5271484bbe700e6c3816be","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"dreame4","email":"a.babik@designfortress.com"},"maintainers":[{"name":"dreame4","email":"a.babik@designfortress.com"}],"dist":{"shasum":"3dd9dff900835664da5271484bbe700e6c3816be","tarball":"https://registry.npmjs.org/es6-comprehensions/-/es6-comprehensions-0.3.1.tgz","integrity":"sha512-aKkvaTo5kFcKdI9Ie/ruJjyUFUT5ZRPrcH/NiComUqy94V51y9up5gL+vCqbAjng0klP/AOmSEebkHEPqbsYnA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEHCfR9cg1lNDBUplWB54E7zLU7n+41fbHVLRp15bl2OAiACNyaHOEmqp4RuydIs+P5jNWMnlGd4pn7vSq6/tE8ZGA=="}]}}},"readme":"# es6-comprehensions\n\nCompiles JavaScript array comprehensions (proposed in ES6) to ES5-compatible syntax. For instance:\n\n```js\nvar squared = [ for (x of [1,2,3,4,5]) if (x > 2) x * x ];\n```\n\ncompiles to:\n\n```js\nvar $__getIterator = function(iterable) { ... };\nvar $__arrayIterator = function(array) { ... };\n\nvar squared = function() {\n  var $__result = [];\n\n  for (var $__0 = $__getIterator([1,2,3,4,5]), $__1; !($__1 = $__0.next()).done; ) {\n    var x = $__1.value;\n\n    if (x > 2) {\n      $__result.push(x * x);\n    }\n  }\n\n  return $__result;\n}.bind(this)();\n```\n\nI'm glad to inform you that **es6-comprehensions** is now a part of [es-next](https://github.com/square/esnext) project.\n\nFor more information check out [the current draft for ECMAScript 6](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array-comprehension).\n\nPlease notice that the syntax has changed and many resources is still using the old one.\n\n## Installation\n\n```\n$ npm install es6-comprehensions [--save]\n```\n\n## Support\n\nArray comprehensions progressed to the Draft ECMAScript 6 Specification. It doesn't mean that there will be no changes or that array comprehensions will be included in the final ES6 Specification.\n\nES6 defines also [iterators](http://tc39wiki.calculist.org/es6/iterators/) that can be used together with [for-of loops](http://tc39wiki.calculist.org/es6/for-of/) that can be used in array comprehensions. This translator does **not** support iterators in `for-of` loops. It translates `for-of` loops to plain `for` loops. Thus, it supports only plain JS arrays.\n\n## Todo\n\n* Consider replacing plain `for` loop with `forEach` method. It will result in more compact code,\n* ~~Consider migration to escodegen.~~ Removed in order to follow up [esnext's](https://github.com/square/esnext) dependencies.\n\n## Development\n\n1. Clone the repository.\n2. Run `npm install`.\n3. Do your changes.\n\nPull requests are highly appreciated.\n\n## Changelog\n\n### v0.3.1\n\n* Switched to [`esprima-fb`](https://github.com/facebook/esprima).\n\n### v0.3.0\n\n* Added support for `for...of` loop. (Thanks [@vslinko](https://github.com/vslinko) for PR.) **Important!** Generated code contains two more necessary functions.\n\n### v0.2.3\n\n* Binding current scope to the generated function expression. This allows one to use `this` in an array comprehension. An example can be found in [a test file](https://github.com/dreame4/es6-comprehensions/blob/master/test/parser_test.js#L48). (Thanks [@vslinko](https://github.com/vslinko) for PR.)\n\n### v0.2.2\n\n* Using [ast-util](https://github.com/square/ast-util) to generate safe temporary variables.\n\n### v0.2.1\n\n* Replaced ComprehensionExpression with CallExpression instead of ExpressionStatement.\n\n### v0.2.0\n\n* Changed API to conform to [esnext's](https://github.com/square/esnext) requirements.\n\n## License\n\nBSD\n","maintainers":[{"name":"dreame4","email":"a.babik@designfortress.com"}],"time":{"modified":"2022-06-17T08:59:51.451Z","created":"2013-12-02T17:20:30.625Z","0.1.0":"2013-12-02T17:20:36.023Z","0.1.1":"2013-12-03T09:27:24.462Z","0.1.2":"2013-12-04T21:04:39.763Z","0.1.3":"2014-01-01T21:59:22.097Z","0.2.0":"2014-04-19T20:57:27.363Z","0.2.1":"2014-05-03T11:12:05.550Z","0.2.2":"2014-05-07T17:08:16.730Z","0.2.3":"2014-05-26T16:54:15.694Z","0.3.0":"2014-06-05T17:48:14.918Z","0.3.1":"2014-10-01T08:58:01.080Z"},"author":{"name":"Adam Babik"},"repository":{"type":"git","url":"https://github.com/dreame4/es6-comprehensions.git"},"homepage":"https://github.com/dreame4/es6-comprehensions","keywords":["array","list","comprehension","es6","es5","parser","ast"],"bugs":{"url":"https://github.com/dreame4/es6-comprehensions/issues"},"license":"BSD-2-Clause","readmeFilename":"README.md"}