{"_id":"5to6","_rev":"7-9e12e11b31d71a0dce8d53eab7b938da","name":"5to6","description":"Convert (partial) ES5 to ES6","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"5to6","version":"0.0.1","description":"Convert (partial) ES5 to ES6","main":"src/index.js","bin":{"5to6":"./bin/5to6.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git@github.com:thomasloh/5to6.git"},"keywords":["5to6","es5","es6","convert","babel","javascript","recast"],"author":{"name":"thomasloh"},"license":"MIT","bugs":{"url":"https://github.com/thomasloh/5to6/issues"},"homepage":"https://github.com/thomasloh/5to6","dependencies":{"bluebird":"^2.9.13","colors":"^1.0.3","commander":"^2.6.0","glob":"^4.4.1","lodash":"^3.3.1","recast":"^0.10.1","set":"^1.1.1"},"gitHead":"a1f4c4e301aa58618298867ce4c3ca5b64874b6a","_id":"5to6@0.0.1","_shasum":"af2e596e3dc340474e059867ea80d6ef53137c2b","_from":".","_npmVersion":"2.6.1","_nodeVersion":"0.12.0","_npmUser":{"name":"thomasloh","email":"thomasloh.sf@gmail.com"},"maintainers":[{"name":"thomasloh","email":"thomasloh.sf@gmail.com"}],"dist":{"shasum":"af2e596e3dc340474e059867ea80d6ef53137c2b","tarball":"https://registry.npmjs.org/5to6/-/5to6-0.0.1.tgz","integrity":"sha512-Q6sckmRloqQbvsOVatBoMnQoZflz8pVbCByLxx+itcIvzdmcvG8Tx6xOmOlHJ1OOVEjFSJz277GRWhev/oid0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICmEAQFaaS/k7JrnKqS76q6dEQisR9Haoq6noU/zikvvAiEAr6PkZNVwR0EYo1Sp1+TnfmVLi5tddb7B5YB0Z0BYPJc="}]}},"0.0.2":{"name":"5to6","version":"0.0.2","description":"Convert (partial) ES5 to ES6","main":"src/index.js","bin":{"5to6":"./bin/5to6.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git@github.com:thomasloh/5to6.git"},"keywords":["5to6","es5","es6","convert","babel","javascript","recast"],"author":{"name":"thomasloh"},"license":"MIT","bugs":{"url":"https://github.com/thomasloh/5to6/issues"},"homepage":"https://github.com/thomasloh/5to6","dependencies":{"bluebird":"^2.9.13","colors":"^1.0.3","commander":"^2.6.0","glob":"^4.4.1","lodash":"^3.3.1","recast":"^0.10.1","set":"^1.1.1"},"gitHead":"a525faf1da9adaf0fddede6fd7547c2e34ca391e","_id":"5to6@0.0.2","_shasum":"3cbc2b72a8dbe25a3678da88df54464f62b788b6","_from":".","_npmVersion":"2.6.1","_nodeVersion":"0.12.0","_npmUser":{"name":"thomasloh","email":"thomasloh.sf@gmail.com"},"maintainers":[{"name":"thomasloh","email":"thomasloh.sf@gmail.com"}],"dist":{"shasum":"3cbc2b72a8dbe25a3678da88df54464f62b788b6","tarball":"https://registry.npmjs.org/5to6/-/5to6-0.0.2.tgz","integrity":"sha512-I15qEV5C6uXSyqfeBWty7RBusovLcXhDH4E4Wqt7FrrcdeqmsBSmAbuD9ZYJDWAyLQuZjH7t3L8HUdREAEROLg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGheUehZlMyFW2tVH2SVJ9j77Zwk6UnJm3zZfRcakKW7AiBl0TdjQJeaa3RA6y7UceR7VKPMmFParJ2ffhYh7QfuXA=="}]}},"0.0.3":{"name":"5to6","version":"0.0.3","description":"Convert (partial) ES5 to ES6","main":"src/index.js","bin":{"5to6":"./bin/5to6.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git@github.com:thomasloh/5to6.git"},"keywords":["5to6","es5","es6","convert","babel","javascript","recast"],"author":{"name":"thomasloh"},"license":"MIT","bugs":{"url":"https://github.com/thomasloh/5to6/issues"},"homepage":"https://github.com/thomasloh/5to6","dependencies":{"bluebird":"^2.9.13","colors":"^1.0.3","commander":"^2.6.0","glob":"^4.4.1","lodash":"^3.3.1","recast":"^0.10.1","set":"^1.1.1"},"gitHead":"9b26187b680bc86a541893c7f874a534b0ce1737","_id":"5to6@0.0.3","_shasum":"103360e4b472eede81d35c8e0b5ab39b123f68d4","_from":".","_npmVersion":"2.7.6","_nodeVersion":"0.12.2","_npmUser":{"name":"thomasloh","email":"thomasloh.sf@gmail.com"},"maintainers":[{"name":"thomasloh","email":"thomasloh.sf@gmail.com"}],"dist":{"shasum":"103360e4b472eede81d35c8e0b5ab39b123f68d4","tarball":"https://registry.npmjs.org/5to6/-/5to6-0.0.3.tgz","integrity":"sha512-yxpvWuwUhUGT9KFt9TdfhGWz6IcZ6CFg+mAlhnJ/tS6SS46RPrENbT+vedVuvAHWsoYG7Nbb///X6ejr+r/Iow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFl8K0ePHaEeDgjPC1IXAzHJT2SZg8c7t07+RC/CV3pQAiEAozknZTWVIXevEAti62epd+JzfOmoS9s1dhpK3L0N3EI="}]}}},"readme":"# Note: Experimental\n\n5to6\n========================\n\n[Motivation](https://medium.com/@thomas_loh/es5-es6-e55e9bf59819)\n\nConverts (partial) ES5 code to ES6. Converted files are expected to be used with  ES6 transpilers like Babel.\n\nUses [recast](https://github.com/benjamn/recast) to get code's AST and detect then modify certain syntax to the equivalent in ES6. Semantics don't change, only the syntax.\n\n# Supported conversions\n\n```javascript\nvar b = {\n abc: abc\n}\n=>\nvar b = {\n abc\n}\n\n{\n abc: function() {\n   console.log('a')\n }\n}\n=>\n{\n abc() {\n   console.log('a')\n }\n}\n\nmodule.exports = Component\n=>\nexport default Component\n\nvar Foo = require('foo')\n=>\nimport Foo from 'foo'\n\nvar Bar = require('foo').Bar\n=>\nimport {Bar} from 'foo'\n\nrequire('foo')\n=>\nimport 'foo'\n\nvar Foo = require('foo')\nvar Bar = Foo.Bar\nvar Baz = Foo.Baz\n=>\nimport Foo, {Bar, Baz} from 'foo'\n```\n\n# Install\n\n```bash\nsudo npm install 5to6 -g\n```\n\n# Usage\n\n```bash\n5to6 -s src    # converts all js or jsx files in \"src\" folder (relative to current directory)\n\n5to6 -s .      # converts all js or jsx files in current directory\n\n5to6 -s . -v   # verbose mode\n```\n\n# Caveats\n\nThis lib was initially created to convert a particular project's codebase to ES6, so it assumes certain code structure. If your codebase is using the commonjs style modules structure, it should work. Codebase with everything in one big closure will not work. Again, this lib is experimental.\n\n5to6 directly writes to file after conversion. So it depends on git, not for conversion, but for reversion in case output is not as expected etc.\n\nTo revert conversion, simply run\n\n```bash\ngit reset --hard\n```\n\n# Credits\n\nHuge credit goes to [recast](https://github.com/benjamn/recast) by [benjamn](https://github.com/benjamn)\n","maintainers":[{"name":"thomasloh","email":"thomasloh.sf@gmail.com"}],"time":{"modified":"2022-06-12T14:08:14.425Z","created":"2015-03-05T05:58:17.523Z","0.0.1":"2015-03-05T05:58:17.523Z","0.0.2":"2015-03-06T06:35:47.651Z","0.0.3":"2015-04-17T16:30:16.471Z"},"homepage":"https://github.com/thomasloh/5to6","keywords":["5to6","es5","es6","convert","babel","javascript","recast"],"repository":{"type":"git","url":"git@github.com:thomasloh/5to6.git"},"author":{"name":"thomasloh"},"bugs":{"url":"https://github.com/thomasloh/5to6/issues"},"license":"MIT","readmeFilename":"README.md"}