# babel-plugin-id

> [![Build Status](https://travis-ci.org/oreqizer/babel-plugin-id.svg?branch=master)](https://travis-ci.org/oreqizer/babel-plugin-id) [![codecov](https://codecov.io/gh/oreqizer/babel-plugin-id/branch/master/graph/badge.svg)](https://codecov.io/gh/oreqizer/b

Latest version **1.0.1** (published 2018-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-id
pnpm add babel-plugin-id
yarn add babel-plugin-id
bun add babel-plugin-id
```

## 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.0.1 |
| Published | 2018-07-13 |
| First published | 2018-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | oreqizer |
| Maintainers | oreqizer |
| Keywords | babel, plugin |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-id
- Repository: https://github.com/oreqizer/babel-plugin-id
- Homepage: https://github.com/oreqizer/babel-plugin-id#readme
- Issues: https://github.com/oreqizer/npm-module/issues
- npm.io page: https://npm.io/package/babel-plugin-id

## 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.0.1 (latest) — 2018-07-13
- 1.0.0 — 2018-07-12
- 0.1.0 — 2018-07-12

## README

# babel-plugin-id

[![Build Status](https://travis-ci.org/oreqizer/babel-plugin-id.svg?branch=master)](https://travis-ci.org/oreqizer/babel-plugin-id)
[![codecov](https://codecov.io/gh/oreqizer/babel-plugin-id/branch/master/graph/badge.svg)](https://codecov.io/gh/oreqizer/babel-plugin-id)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![npm (scoped)](https://img.shields.io/npm/v/babel-plugin-id.svg)](https://www.npmjs.com/package/babel-plugin-id)

Literally all it does is it evaluates a function to its argument. Useful for **translation collection**, for example.

Function name defaults to `__`.

## Setup

Just add `id` to the list of babel plugins, e.g. to `.babelrc`:

```json
{
  "plugins": ["id"]
}
```

### Example

```js
// Input:
const text = __("Translate me");

// Output:
const text = "Translate me";
```

## Config

To change the function name, add an object with the `fn` property to your config:

```json
{
  "plugins": [["id", { "fn": "t" }]]
}
```

This will evaluate functions named `t`.

### Example

```js
// Input:
const text = t("Translate me");

// Output:
const text = "Translate me";
```

## License

MIT

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