Gathering detailed insights and metrics for space-separated-tokens
Gathering detailed insights and metrics for space-separated-tokens
Gathering detailed insights and metrics for space-separated-tokens
Gathering detailed insights and metrics for space-separated-tokens
npm install space-separated-tokens
Typescript
Module System
Node Version
NPM Version
99.6
Supply Chain
98.6
Quality
75.6
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
10 Stars
64 Commits
1 Forks
2 Watchers
1 Branches
3 Contributors
Updated on Apr 28, 2024
Latest Version
2.0.2
Package Id
space-separated-tokens@2.0.2
Unpacked Size
7.57 kB
Size
3.14 kB
File Count
5
NPM Version
8.19.2
Node Version
19.0.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Parse and stringify space-separated tokens.
This is a tiny package that can parse and stringify space-separated tokens, as
used for example in the HTML class
attribute, according to the
WHATWG spec.
This package is rather niche, it’s low-level and particularly useful when working with hast.
This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:
1npm install space-separated-tokens
In Deno with esm.sh
:
1import {parse, stringify} from 'https://esm.sh/space-separated-tokens@2'
In browsers with esm.sh
:
1<script type="module"> 2 import {parse, stringify} from 'https://esm.sh/space-separated-tokens@2?bundle' 3</script>
1import {parse, stringify} from 'space-separated-tokens' 2 3parse(' foo\tbar\nbaz ') 4//=> ['foo', 'bar', 'baz'] 5 6stringify(['foo', 'bar', 'baz']) 7//=> 'foo bar baz'
This package exports the identifiers parse
and stringify
.
There is no default export.
parse(value)
Parse space-separated tokens (string
) to an array of strings
(Array<string>
), according to the WHATWG spec.
stringify(values)
Serialize an array of strings or numbers (Array<string|number>
) to
space-separated tokens (string
).
👉 Note: it’s not possible to specify empty or whitespace only values.
This package is fully typed with TypeScript. It exports no additional types.
This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. It also works in Deno and modern browsers.
comma-separated-tokens
— parse/stringify comma-separated tokenscollapse-white-space
— replace multiple white-space characters with a single spaceproperty-information
— info on HTML propertiesYes please! See How to Contribute to Open Source.
This package is safe.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More