Turn your vanilla Java Script into a Venti Iced Skinny Hazelnut Macchiato, Sugar-Free Syrup, Extra Shot, Light Ice, No Whip Script
Turn your vanilla Java Script into a Venti Iced Skinny Hazelnut Macchiato, Sugar-Free Syrup, Extra Shot, Light Ice, No Whip Script
Sort of like 6to5 except backwards. ES5 code goes in, ES6 code comes out.
npm install sixit
sixit directory
sixit(code: string, opts = {}: ?object): string
var sixit = require('sixit')
var magicalAwesomeCode = sixit(yourBoringCode)
The transforms are configurable. These are the available options along with their default values. If an options object is passed to sixit it overrides all the options.
{
"arrow": false,
"exports": false,
"imports": false,
"let": true,
"method": true,
"module": false,
"shorthand": true,
"strict": true
}
arrow
transforms function expressions into arrow functionsexports
transforms module.exports to export syntaximports
transforms require into import syntaxlet
converts all your vars into letmethod
converts methods in object expressions into concise formmodule
is a catch-all that does both import and exportshorthand
converts properties that have the same key/value into concisestrict
adds the use strict pragma at the top of the file