# babel-plugin-transform-string-join

> Babel plugin that join strings and template strings in compilation when possible

Latest version **1.0.2** (published 2018-12-03) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2018-12-03 |
| First published | 2016-09-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | LaySent |
| Maintainers | laysent |
| Keywords | string, concat, join, babel-plugin |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-transform-string-join
- Repository: https://github.com/laysent/babel-plugin-transform-string-join
- Homepage: https://github.com/laysent/babel-plugin-transform-string-join#readme
- Issues: https://github.com/laysent/babel-plugin-transform-string-join/issues
- npm.io page: https://npm.io/package/babel-plugin-transform-string-join

## Dependencies (1)

- [babel-types](https://npm.io/package/babel-types.md) 6.x

## 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.2 (latest) — 2018-12-03
- 1.0.1 — 2017-03-03
- 1.0.0 — 2016-09-26

## README

# babel-plugin-transform-string-join

[![Build Status](https://travis-ci.org/laysent/babel-plugin-transform-string-join.svg?branch=master)](https://travis-ci.org/laysent/babel-plugin-transform-string-join)

Babel plugin that will join strings and template strings in compilation time whenever it's possible.

## Examples

### Array.proptotype.join

You can use `Array.proptotype.join` to join list of strings and template strings together.

**In**

```js
const className = 'container';
const html = [
  `<div class=${className}>`,
    '<span>Hello World</span>',
  '</div>',
].join('');
```

**Out**

```js
const html = `<div class=${className}><span>Hello World</span></div>`;
```

### String addition

Also, you can use `+` to simply concat strings and template strings together.

**In**

```js
const className = 'container';
const html =
  `<div class=${className}>` +
    '<span>Hello World</span>' +
  '</div>';
```

**Out**

```js
const html = `<div class=${className}><span>Hello World</span></div>`;
```

## Installation

```sh
$ npm install babel-plugin-transform-string-join
```

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

```json
{
  "plugins": ["transform-string-join"]
}
```

### Via CLI

```sh
$ babel --plugins transform-string-join script.js
```

### Via Node API

```javascript
require('babel-core').transform('code', {
  plugins: ['transform-string-join']
});
```

## License

MIT

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