smart-splitter

3.1.0 • Public • Published

Smart Splitter

GitHub release npm Travis (.com)

Split strings the smarter way.

Why?

A developer might parse arguments using String#split, but this falls apart as soon as multi-word arguments need to be parsed:

"--force -m hey!".split(" "); // It works...
"--force -m 'hello world'".split(" "); // Nope: [..., "'hello", "world'"]

Smart Splitter aims to solve this problem. Quoted text remains as one string and does not contain quotes:

smartSplit("--force -m 'hello world'"); // Nice: ["--force", "-m", "hello world"]

Dependencies (0)

    Dev Dependencies (9)

    Package Sidebar

    Install

    npm i smart-splitter

    Weekly Downloads

    0

    Version

    3.1.0

    License

    MIT

    Unpacked Size

    7.1 kB

    Total Files

    7

    Last publish

    Collaborators

    • haykam821