Socket
Socket
Sign inDemoInstall

split-string

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

split-string

Easy way to split a string on a given character unless it's quoted or escaped.


Version published
Weekly downloads
8.6M
decreased by-21.37%
Maintainers
2
Weekly downloads
 
Created

What is split-string?

The split-string npm package is used to split strings on a specified separator while respecting nested structures such as quotes, brackets, and parentheses. It provides a way to parse complex strings with multiple levels of nested delimiters.

What are split-string's main functionalities?

Basic string splitting

Splits a string into an array of substrings using the specified separator.

"a.b.c".split('.')

Splitting with escaped characters

Splits a string on a separator while allowing escaped characters to be included in the results.

splitString('a\.b.c', { separator: '.' })

Splitting with brackets

Splits a string on a separator while respecting nested brackets, keeping them as part of the split segments.

splitString('a.{b.c}.d', { brackets: true })

Customizing separators and brackets

Allows customization of separators and bracket pairs for more complex string splitting scenarios.

splitString('a.{b.c}.d', { separators: ['.', ' '], brackets: { '{': '}' } })

Other packages similar to split-string

Keywords

FAQs

Package last updated on 22 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc