Negligent Parachute Maintainers
    Have ideas to improve npm?Join in the discussion! »

    space-separated-tokens
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.4 • Public • Published

    space-separated-tokens

    Build Coverage Downloads Size

    Parse and stringify space-separated tokens according to the spec.

    Installation

    npm:

    npm install space-separated-tokens

    Usage

    var spaceSeparated = require('space-separated-tokens')
     
    spaceSeparated.parse(' foo\tbar\nbaz  ')
    //=> ['foo', 'bar', 'baz']
     
    spaceSeparated.stringify(['foo', 'bar', 'baz'])
    //=> 'foo bar baz'

    API

    spaceSeparated.parse(value)

    Parse space-separated tokens to an array of strings, according to the spec.

    Parameters
    • value (string) — space-separated tokens.
    Returns

    Array.<string> — List of tokens.

    spaceSeparated.stringify(values)

    Compile an array of strings to space-separated tokens. Note that it’s not possible to specify empty or white-space only values.

    Parameters
    • values (Array.<string>) — List of tokens.
    Returns

    string — Space-separated tokens.

    Related

    License

    MIT © Titus Wormer

    Install

    npm i [email protected]

    Version

    1.1.4

    License

    MIT

    Unpacked Size

    5.51 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar