# string-split-by

> Split string by any separator excluding brackets, quotes and escaped characters

Latest version **1.0.0** (published 2018-05-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install string-split-by
pnpm add string-split-by
yarn add string-split-by
bun add string-split-by
```

## 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.0 |
| Published | 2018-05-28 |
| First published | 2018-05-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Dmitry Yv |
| Maintainers | dfcreative |
| Keywords | split-string, string-split, split-stirng-words, space, string, split |

## Links

- npm: https://www.npmjs.com/package/string-split-by
- Repository: https://github.com/dy/string-split-by
- Homepage: https://github.com/dy/string-split-by#readme
- Issues: https://github.com/dy/string-split-by/issues
- npm.io page: https://npm.io/package/string-split-by

## Dependencies (1)

- [parenthesis](https://npm.io/package/parenthesis.md) ^3.1.5

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-05-28

## README

# string-split-by [![unstable](https://img.shields.io/badge/stability-unstable-orange.svg)](http://github.com/badges/stability-badges) [![Build Status](https://img.shields.io/travis/dy/string-split-by.svg)](https://travis-ci.org/dy/string-split-by)

Split string by a separator with respect to brackets, quotes and escape markers. Optimized version of [string-split](https://github.com/jonschlinkert/split-string).

## Usage

[![npm install string-split-by](https://nodei.co/npm/string-split-by.png?mini=true)](https://npmjs.org/package/string-split-by/)


```js
var split = require('string-split-by')

split('a."b.c".d.{.e.f.g.}.h', '.')
// ['a', '"b.c"', 'd', '{.e.f.g.}', 'h']

split('a."b.c".d.{.e.f.g.}.h', '.', {ignore: '""'})
// ['a', '"b.c"', 'd', '{', 'e', 'f', 'g', '}', 'h']
```

## API

### parts = splitBy(string, separator, options?)

Return array with parts split from string by a separator, which can be whether _String_ or _RegExp_. Options can define:

Option | Default | Meaning
---|---|---
`ignore` | ``['"', "'", '`', '“”', '«»', '[]', '()', '{}']`` | Avoid splitting content enclosed in the character pairs. Can be a string or a list of strings.
`escape` | `true` | Avoid splitting at the escaped separator, eg. `\.` won't be separated by `'.'` separator.


## Related

* [parenthesis](http://npmjs.org/package/parenthesis)

## License

© 2018 Dmitry Yv. MIT License

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