# babel-helper-simplify-module

> Transform module using babel-explode-module to have a simpler structure

Latest version **2.2.1** (published 2018-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-helper-simplify-module
pnpm add babel-helper-simplify-module
yarn add babel-helper-simplify-module
bun add babel-helper-simplify-module
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.1 |
| Published | 2018-08-17 |
| First published | 2017-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | James Kyle |
| Maintainers | thejameskyle |

## Links

- npm: https://www.npmjs.com/package/babel-helper-simplify-module
- Repository: https://github.com/thejameskyle/babel-helper-simplify-module
- Homepage: https://github.com/thejameskyle/babel-helper-simplify-module#readme
- Issues: https://github.com/thejameskyle/babel-helper-simplify-module/issues
- npm.io page: https://npm.io/package/babel-helper-simplify-module

## Dependencies (1)

- [babel-explode-module](https://npm.io/package/babel-explode-module.md) ^1.4.0

## Recent versions

- 2.2.1 (latest) — 2018-08-17
- 2.2.0 — 2017-06-02
- 2.1.2 — 2017-05-30
- 2.1.1 — 2017-05-29
- 2.1.0 — 2017-05-25
- 2.0.0 — 2017-05-25
- 1.0.0 — 2017-05-25

## README

# babel-helper-simplify-module

> Transform module using [babel-explode-module](https://github.com/babel-utils/babel-explode-module) to have a simpler structure

```js
import {simplifyModule} from 'babel-helper-simplify-module';

simplifyModule(programPath);
```

**Before:**

```js
import foo from "mod";
import {bar} from "mod";

export default function() {
  // ...
}

export const baz = 42,
             bat = "hello world";

export * from "bam";
```

**After:**

```js
import foo, {bar} from "mod";

function _default() {
  // ...
}

const baz = 42;
const bat = "hello world";

export default _default;
export { baz };
export { bat };
export * from "bam";
```

## API

### `explodedToStatements(exploded)`

```js
import explodeModule from 'babel-explode-module';
import {explodedToStatements} from 'babel-helper-simplify-module';

let exploded = explodeModule(node);
let statements = explodedToStatements(exploded);
```

### `simplifyModule(path)`

> This mutates the program.

```js
import {simplifyModule} from 'babel-helper-simplify-module';

simplifyModule(programPath);
```

---
_Source: https://npm.io/package/babel-helper-simplify-module · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
