Skip to content

Instantly share code, notes, and snippets.

View jslatts's full-sized avatar

Justin Slattery jslatts

View GitHub Profile
@jslatts
jslatts / requiresToImports.js
Created April 14, 2016 21:35 — forked from dmnd/requiresToImports.js
Converts commonJS requires to es6 imports
// converts commonJS requires to es6 imports
// var foo = require('foo');
// ->
// import foo from 'foo';
//
// jscodeshift -t requiresToImports.js src/**/*.js*
'use strict';
module.exports = function(fileInfo, api) {
var j = api.jscodeshift;