# strip-brackets

> Strips unecessary brackets

Latest version **1.0.1** (published 2017-06-03) · 0 weekly downloads

## Install

```sh
npm install strip-brackets
pnpm add strip-brackets
yarn add strip-brackets
bun add strip-brackets
```

## 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 | 2017-06-03 |
| First published | 2017-06-02 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | spudly |

## Links

- npm: https://www.npmjs.com/package/strip-brackets
- Repository: https://github.com/spudly/strip-brackets
- Homepage: https://github.com/spudly/strip-brackets#readme
- Issues: https://github.com/spudly/strip-brackets/issues
- npm.io page: https://npm.io/package/strip-brackets

## Recent versions

- 1.0.1 (latest) — 2017-06-03
- 1.0.0 — 2017-06-02

## README

# strip-brackets

Strips unecessary brackets

[![Greenkeeper badge](https://badges.greenkeeper.io/spudly/strip-brackets.svg)](https://greenkeeper.io/)

## Usage

Pass it some configuration parameters and it will give you a new function that strips all unnecessary brackets.

#### Function Signature
```js
stripBrackets(openChar = '[', closeChar = ']', joinChars = [',']) => input => output
```

```js
import stripBrackets from 'strip-brackets';

const stripSquareBrackets = stripBrackets('[', ']', [',']);
stripSquareBrackets('[[a,b],[c],[[d]]]'); // => "[a,b],c,d"

const stripParens = stripBrackets('(', ')', [',']);
stripParens('((a,b),(c),((d)))'); // => "(a,b),c,d"
```

#### Parameters

<dl>
  <dt>openChar</dt>
  <dd>The opening bracket. Default: `[`

  <dt>closeChar</dt>
  <dd>The closing bracket. Default: `]`

  <dt>joinChars</dt>
  <dd>Characters that indicate that the current part of the string should be wrapped in brackets. Default: `[","]`

  <dt>input</dt>
  <dd>The string you want to strip brackets from</dd>

  <dt>output<dt>
  <dd>The resulting string, with unnecessary brackets removed</dd>
</dl>

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