# babel-plugin-closure-elimination

> Removes closures from your JavaScript in the name of performance.

Latest version **1.3.2** (published 2020-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-closure-elimination
pnpm add babel-plugin-closure-elimination
yarn add babel-plugin-closure-elimination
bun add babel-plugin-closure-elimination
```

## 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 | 1.3.2 |
| Published | 2020-08-25 |
| First published | 2015-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 364 |
| Author | Charles Pick |
| Maintainers | charlespick, gajus, gvozd |
| Keywords | babel, babel-plugin, closure-elimination, closure, optimization |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-closure-elimination
- Repository: https://github.com/codemix/babel-plugin-closure-elimination
- Issues: https://github.com/codemix/babel-plugin-closure-elimination/issues
- npm.io page: https://npm.io/package/babel-plugin-closure-elimination

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.3.2 (latest) — 2020-08-25
- 1.3.1 — 2020-04-23
- 1.3.0 — 2017-10-12
- 1.2.1 — 2017-09-24
- 1.2.0 — 2017-09-02
- 1.1.16 — 2017-05-14
- 1.1.15 — 2017-05-02
- 1.1.14 — 2016-11-09
- 1.1.13 — 2016-11-09
- 1.1.12 — 2016-11-08
- 1.1.11 — 2016-11-02
- 1.1.8 — 2016-11-02
- 1.1.7 — 2016-11-02
- 1.1.6 — 2016-11-01
- 1.1.5 — 2016-10-31
- … 9 more at https://npm.io/package/babel-plugin-closure-elimination/versions

## README

# Babel Closure Elimination

This is a [Babel](https://babeljs.io/) plugin that eliminates unnecessary closures from your JavaScript in the name of performance.

[![Build Status](https://travis-ci.org/codemix/babel-plugin-closure-elimination.svg)](https://travis-ci.org/codemix/babel-plugin-closure-elimination)

> Note: Now requires Babel 6.

# What?

Turns code like this:
```js
function demo (input) {
  return input.map(item => item + 1).map(item => item + 2);
}
```
Into code like this:
```js
function _ref(item) {
  return item + 1;
}

function _ref2(item) {
  return item + 2;
}

function demo(input) {
  return input.map(_ref).map(_ref2);
}

```

# Why?

Because it's faster and more memory efficient in [most JavaScript engines](http://jsperf.com/closure-elimination), and means you can safely use arrow functions without a performance penalty in most cases.

# Installation

First, install via [npm](https://npmjs.org/package/babel-plugin-closure-elimination).
```sh
npm install --save-dev babel-plugin-closure-elimination
```
Then, in your babel configuration (usually in your `.babelrc` file), add `"closure-elimination"` to your list of plugins:
```json
{
  "plugins": ["closure-elimination"]
}
```


# License

Published by [codemix](http://codemix.com/) under a permissive MIT License, see [LICENSE.md](./LICENSE.md).

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