Socket
Socket
Sign inDemoInstall

space-separated-tokens

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    space-separated-tokens

Parse and stringify space-separated tokens


Version published
Weekly downloads
7.9M
decreased by-19.11%
Maintainers
1
Install size
6.55 kB
Created
Weekly downloads
 

Readme

Source

space-separated-tokens

Build Coverage Downloads Size

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

Install

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)

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

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

string — Space-separated tokens.

License

MIT © Titus Wormer

Keywords

FAQs

Last updated on 23 Jan 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc