{"id":13725755,"url":"https://github.com/codemix/babel-plugin-closure-elimination","last_synced_at":"2025-04-13T05:04:25.708Z","repository":{"id":31860199,"uuid":"35427878","full_name":"codemix/babel-plugin-closure-elimination","owner":"codemix","description":"A Babel plugin which eliminates closures from your JavaScript wherever possible.","archived":false,"fork":false,"pushed_at":"2022-12-11T03:00:21.000Z","size":399,"stargazers_count":367,"open_issues_count":4,"forks_count":15,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-13T05:03:43.404Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codemix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-11T14:08:27.000Z","updated_at":"2024-10-25T10:15:57.000Z","dependencies_parsed_at":"2023-01-14T19:55:16.274Z","dependency_job_id":null,"html_url":"https://github.com/codemix/babel-plugin-closure-elimination","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemix%2Fbabel-plugin-closure-elimination","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemix%2Fbabel-plugin-closure-elimination/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemix%2Fbabel-plugin-closure-elimination/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemix%2Fbabel-plugin-closure-elimination/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemix","download_url":"https://codeload.github.com/codemix/babel-plugin-closure-elimination/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665748,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:02:33.928Z","updated_at":"2025-04-13T05:04:25.677Z","avatar_url":"https://github.com/codemix.png","language":"JavaScript","funding_links":[],"categories":["Plugins","JavaScript"],"sub_categories":["Optimization"],"readme":"# Babel Closure Elimination\n\nThis is a [Babel](https://babeljs.io/) plugin that eliminates unnecessary closures from your JavaScript in the name of performance.\n\n[![Build Status](https://travis-ci.org/codemix/babel-plugin-closure-elimination.svg)](https://travis-ci.org/codemix/babel-plugin-closure-elimination)\n\n\u003e Note: Now requires Babel 6.\n\n# What?\n\nTurns code like this:\n```js\nfunction demo (input) {\n  return input.map(item =\u003e item + 1).map(item =\u003e item + 2);\n}\n```\nInto code like this:\n```js\nfunction _ref(item) {\n  return item + 1;\n}\n\nfunction _ref2(item) {\n  return item + 2;\n}\n\nfunction demo(input) {\n  return input.map(_ref).map(_ref2);\n}\n\n```\n\n# Why?\n\nBecause 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.\n\n# Installation\n\nFirst, install via [npm](https://npmjs.org/package/babel-plugin-closure-elimination).\n```sh\nnpm install --save-dev babel-plugin-closure-elimination\n```\nThen, in your babel configuration (usually in your `.babelrc` file), add `\"closure-elimination\"` to your list of plugins:\n```json\n{\n  \"plugins\": [\"closure-elimination\"]\n}\n```\n\n\n# License\n\nPublished by [codemix](http://codemix.com/) under a permissive MIT License, see [LICENSE.md](./LICENSE.md).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemix%2Fbabel-plugin-closure-elimination","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemix%2Fbabel-plugin-closure-elimination","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemix%2Fbabel-plugin-closure-elimination/lists"}