rewrite-exports
Rewrite `export` statements as `module.exports`s; via RegExp
Last updated 2 years ago by pateketrueke .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rewrite-exports 
SYNC missed versions from official npm registry.

rewrite-exports Build Status

Transforms various export statements into module.exports definitions, using regular expressions.

Heavily inspired by rewrite-imports and meant to be complementary!

Install

$ npm install --save rewrite-exports

Usage

const  rExports  =  require('rewrite-exports');

rExports('export default 42');
//=> module.exports = 42

rExports('export default function () {  }');
//=> module.exports = function () {  }

rExports('export { default } from "./src";');
//=> module.exports = require("./src");

Examine the test.js file to see all supported variations.

API

rExports(input)

input

Type: String

The export statement(s) or the code containing export statement(s).

See MDN for valid export statement syntax.

Current Tags

  • 0.0.1                                ...           latest (2 years ago)

1 Versions

  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 7
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |