# babel-plugin-transform-string-literal-replace

> Babel plugin to find and replace strings in source code

Latest version **1.0.2** (published 2016-12-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-transform-string-literal-replace
pnpm add babel-plugin-transform-string-literal-replace
yarn add babel-plugin-transform-string-literal-replace
bun add babel-plugin-transform-string-literal-replace
```

## 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.2 |
| Published | 2016-12-11 |
| First published | 2016-12-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sebastiaan Deckers |
| Maintainers | seb |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-transform-string-literal-replace
- npm.io page: https://npm.io/package/babel-plugin-transform-string-literal-replace

## Recent versions

- 1.0.2 (latest) — 2016-12-11
- 1.0.1 — 2016-12-11
- 1.0.0 — 2016-12-08

## README

# string-literal-replace

A simple Babel plugin to transform source code by finding and replacing string literals with other values.

## Use Case

Inject constants and other snippets into source code.

## Usage

### `.babelrc`

```json
{
  "plugins": [
    ["transform-string-literal-replace", {
      "Sebastiaan": "Seb",
      "SOME_MESSAGE": 1234567890
    }]
  ]
}
```

```js
import {transform} from 'babel-core'
const input = `var name = 'Sebastiaan';alert('SOME_MESSAGE');`
const output = transform(input)
// -> `var name = 'Seb';alert(1234567890);`
```

## Options

### `pattern`

An `Object` or `Map` containing strings to replace with values that are either `String`, `Number`, `Boolean`, or `null`.

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