1.1.2 • Published 5 years ago

change-default v1.1.2

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

Change Default

Description

Convert exports.default to module.exports for all .js files in specified directories recursively

You can specify directory by --dir option

Note: it will not change if more exports are occurred

Installation

    npm install -g change-default

Github Repository Source Code

Usage

$: change-default --dir=build

--dir is optional

default dir is current directory

Examples

Before

function add(x, y) {
  return x + y;
}
exports.default = add;

After

function add(x, y) {
  return x + y;
}
module.exports = add;

Will not work when:

function add(x, y) {
  return x + y;
}
exports.owner = "Manick";
exports.default = add;

if there is more exports it will not change anything

License

The MIT License (MIT) - 2019