Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/deepraining/conv-mod

把 JavaScript 模块从 AMD 或 CommonJs 规范转化为 ES6 规范. Convert JavaScript module from AMD or CommonJs to ES6.
https://github.com/deepraining/conv-mod

amd commonjs convert es6 module tool

Last synced: about 1 month ago
JSON representation

把 JavaScript 模块从 AMD 或 CommonJs 规范转化为 ES6 规范. Convert JavaScript module from AMD or CommonJs to ES6.

Awesome Lists containing this project

README

        

# conv-mod

[中文文档](./README.md)

Convert JavaScript module from AMD or CommonJs to ES6.

## quick start

Install:

```
npm install conv-mod -g
```

Usage:

```
conv-mod [options] [extraDirs...]
```

## options

- `-f, --filter `: a query string to filter files
- `-r, --regular`: regard query string as regular expression to filter files
- `--amd`: convert AMD modules
- `--cjs`: convert CommonJs modules

## currently can not convert

```
const a = require('a').default;
const {a, b} = require('a');
const a, {b, c} = require('a');
```