• Version 6.1.0
  • Published
  • 19.4 kB
  • No dependencies
  • MIT license


npm i split-string
yarn add split-string
pnpm add split-string


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



function split

split: {
(input: string, options?: Options | SplitFunc): string[];
(input: string, options: Options, fn: SplitFunc): string[];


    interface ASTNode

    interface ASTNode {}

      property nodes

      nodes: ASTNode[];

        property stash

        stash: string[];

          property type

          type: 'root' | 'bracket';

            interface Options

            interface Options {}

              property brackets

              brackets?: { [key: string]: string } | boolean;

                property quotes

                quotes?: string[] | boolean;

                  property separator

                  separator?: string;

                    property strict

                    strict?: boolean;

                      method keep

                      keep: (value: string, state: State) => boolean;

                        interface State

                        interface State {}

                          property input

                          input: string;

                            property separator

                            separator: string;

                              property stack

                              stack: ASTNode[];

                                method bos

                                bos: () => boolean;

                                  method eos

                                  eos: () => boolean;

                                    method next

                                    next: () => string;

                                      method prev

                                      prev: () => string;

                                        Package Files (1)

                                        Dependencies (0)

                                        No dependencies.

                                        Dev Dependencies (4)

                                        Peer Dependencies (0)

                                        No peer dependencies.


                                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/split-string.

                                        • Markdown
                                        • HTML
                                          <a href="https://www.jsdocs.io/package/split-string"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>