Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

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

Last synced: 27 days 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;
```