Split a string on a given character or characters, with support for escaping.
Installations
npm install string-split-by
Releases
Unable to fetch releases
Developer
dy
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
8.11.1
NPM Version
6.1.0
Statistics
2 Stars
4 Commits
3 Watching
1 Branches
1 Contributors
Updated on 23 Jul 2019
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
35,686,094
Last day
-10%
36,074
Compared to previous day
Last week
-2.6%
197,333
Compared to previous week
Last month
-0.3%
863,941
Compared to previous month
Last year
17.1%
10,223,348
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
1
string-split-by
Split string by a separator with respect to brackets, quotes and escape markers. Optimized version of string-split.
Usage
1var split = require('string-split-by') 2 3split('a."b.c".d.{.e.f.g.}.h', '.') 4// ['a', '"b.c"', 'd', '{.e.f.g.}', 'h'] 5 6split('a."b.c".d.{.e.f.g.}.h', '.', {ignore: '""'}) 7// ['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
License
© 2018 Dmitry Yv. MIT License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/4 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
2.6
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More