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

https://github.com/zhengsk/cjs-es6

Convert javascript file from CommonJS type to ES6 type.
https://github.com/zhengsk/cjs-es6

Last synced: 3 months ago
JSON representation

Convert javascript file from CommonJS type to ES6 type.

Awesome Lists containing this project

README

        

# cjs-es6

Convert javascript file from CommonJS type to ES6 type.

## Install

```shell
npm install -S cjs-es6
```

```js
const cjsEs6 = require('cjs-es6');

const codeStr = 'module.exports = abc'
const result = cjsEs6(codeStr); // export default abc;
```