Skip to content

Instantly share code, notes, and snippets.

@jtremback
Last active August 29, 2015 14:22
Show Gist options
  • Save jtremback/55367f74b82e34f639ba to your computer and use it in GitHub Desktop.
Save jtremback/55367f74b82e34f639ba to your computer and use it in GitHub Desktop.
es6 to commonJS module regexes
export function (.*?) \((.*)\)
exports.\1 = \1\nfunction \1(\2)
import \* as (\w*) from ('.*')
var \1 = require(\2)
import (\{(.|\n)*?default as (.*)\}) from (.*)
var \3 = require(\4)\nvar \1 = \3
\n *default as (.*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment