{"name":"comma-separated-tokens","version":"2.0.2","description":"Parse and stringify comma-separated tokens","license":"MIT","keywords":["dom","html","comma","separated","tokens","parse","stringify"],"repository":{"type":"git","url":"git+https://github.com/wooorm/comma-separated-tokens.git"},"bugs":{"url":"https://github.com/wooorm/comma-separated-tokens/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","rimraf":"^3.0.0","tape":"^5.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.39.0"},"scripts":{"prepack":"npm run build && npm run format","build":"rimraf \"*.d.ts\" && tsc && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node test.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"rules":{"no-var":"off","prefer-arrow-callback":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true},"gitHead":"24a298f64febc56d2ac8d5df55b888d24f424671","homepage":"https://github.com/wooorm/comma-separated-tokens#readme","_id":"comma-separated-tokens@2.0.2","_nodeVersion":"15.11.0","_npmVersion":"7.10.0","dist":{"integrity":"sha512-G5yTt3KQN4Yn7Yk4ed73hlZ1evrFKXeUW3086p3PRFNp7m2vIjI6Pg+Kgb+oyzhd9F2qdcoj67+y3SdxL5XWsg==","shasum":"d4c25abb679b7751c880be623c1179780fe1dd98","tarball":"http://registry-npm.ywwl.com/comma-separated-tokens/download/comma-separated-tokens-2.0.2.tgz","fileCount":5,"unpackedSize":7876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghu1ECRA9TVsSAnZWagAAT24QAKB0ypoLJnUQUKgR+wLU\nvbPz3nPA/WzaNreCeqhM347jQT0dZUNu5kPx+6kkE4z4T2s5tWnQ4SYyZa4r\nwVKGCRgOOCni9VmR6taPadLtrzFOig5+RGUyMA58PzUkXsRcP4w2oDZnrSvs\nfuqYm2w/Ru6/derlUmvT9VKx1z4d9dGOUhXp8zwp9PykJZ8INX9qdt3sEeXP\n7ypRkO70tt1B8DIO9d5LpuIlgFvivsG4DsSSlBIXjTctHAwJrFRY24cYJlbB\ncR+LYVHyLq/W7E3S8yNPRoqFDGDJra5CMRg5m8paOFXsMpEhvmRdQDtpacQH\necx2yYpvxHEk/YDmU9qiGjX1AjpFZlwQ6WDZUFXIzTHFbD38628Uzz6J77QL\njkofZE/cqeX0dkNX2pu44jj1BchnbCko3KBu1Wzqc0ImtD7eS14vF01BbGNB\nClvsQ9RqmxuUeWimmgdXvIo4JrIUWBca8iEePNo/q/b/A8pZHwBTAZn+qebp\nStZHcT46b8cNijGeyoF4CbbvSKrVy0Ung849ItZ/luZ85vvOGhbSRw6DQm8K\nUGVf9jYFFEbIxNvO+/6nP8XgRgT2linFGzqd7PR0cqKRCRhpnFobwY5itNbs\n9ku9Yt2NsgUNq6YaHr+Lvqj4XawAA7p/5WmjMgPl7sJWn37+pMwGfEfhKOmV\nrpSv\r\n=8UgD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3ImrC8aUEn+qboxZx22Ka9MDQ4rOEQXWbh2VhVjPJCwIgafI+kdrmfunKPpXPt8RCzh1kf7fEAnF+4uXU+CujkD8="}],"size":3109,"noattachment":false,"key":"/comma-separated-tokens/-/comma-separated-tokens-2.0.2.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/comma-separated-tokens_2.0.2_1619455300468_0.7651367461933269"},"_hasShrinkwrap":false,"readme":"# comma-separated-tokens\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n\nParse and stringify comma-separated tokens.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`parse(value)`](#parsevalue)\n    *   [`stringify(values[, options])`](#stringifyvalues-options)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [Security](#security)\n*   [License](#license)\n\n## What is this?\n\nThis is a tiny package that can parse and stringify comma-separated tokens, as\nused for example in the HTML `accept` attribute, according to the\n[WHATWG spec][spec].\n\n## When should I use this?\n\nThis package is rather niche, it’s low-level and particularly useful when\nworking with [hast][].\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 14.14+, 16.0+), install with [npm][]:\n\n```sh\nnpm install comma-separated-tokens\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {parse, stringify} from 'https://esm.sh/comma-separated-tokens@2'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {parse, stringify} from 'https://esm.sh/comma-separated-tokens@2?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {parse, stringify} from 'comma-separated-tokens'\n\nparse(' a ,b,,d d ') //=> ['a', 'b', '', 'd d']\nstringify(['a', 'b', '', 'd d']) //=> 'a, b, , d d'\n```\n\n## API\n\nThis package exports the identifier `parse` and `stringify`.\nThere is no default export.\n\n### `parse(value)`\n\nParse commma-separated tokens (`string`) to an array of strings\n(`Array<string>`), according to the [WHATWG spec][spec].\n\n### `stringify(values[, options])`\n\nSerialize an array of strings or numbers (`Array<string|number>`) to\ncomma-separated tokens (`string`).\nHandles empty items at start or end correctly.\n\n> 👉 **Note**: it’s not possible to specify initial or final whitespace per\n> value.\n\n##### `options`\n\nConfiguration (optional).\n\n###### `options.padLeft`\n\nWhether to pad a space before a token (`boolean`, default: `true`).\n\n###### `options.padRight`\n\nWhether to pad a space after a token (`boolean`, default: `false`).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional type `Options`.\n\n## Compatibility\n\nThis package is at least compatible with all maintained versions of Node.js.\nAs of now, that is Node.js 14.14+ and 16.0+.\nIt also works in Deno and modern browsers.\n\n## Related\n\n*   [`space-separated-tokens`](https://github.com/wooorm/space-separated-tokens)\n    — parse/stringify space-separated tokens\n*   [`collapse-white-space`](https://github.com/wooorm/collapse-white-space)\n    — replace multiple white-space characters with a single space\n*   [`property-information`](https://github.com/wooorm/property-information)\n    — info on HTML properties\n\n## Contribute\n\nYes please!\nSee [How to Contribute to Open Source][contribute].\n\n## Security\n\nThis package is safe.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/wooorm/comma-separated-tokens/workflows/main/badge.svg\n\n[build]: https://github.com/wooorm/comma-separated-tokens/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/comma-separated-tokens.svg\n\n[coverage]: https://codecov.io/github/wooorm/comma-separated-tokens\n\n[downloads-badge]: https://img.shields.io/npm/dm/comma-separated-tokens.svg\n\n[downloads]: https://www.npmjs.com/package/comma-separated-tokens\n\n[size-badge]: https://img.shields.io/bundlephobia/minzip/comma-separated-tokens.svg\n\n[size]: https://bundlephobia.com/result?p=comma-separated-tokens\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[contribute]: https://opensource.guide/how-to-contribute/\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[spec]: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#comma-separated-tokens\n\n[hast]: https://github.com/syntax-tree/hast\n","publish_time":1619455300610,"_cnpm_publish_time":1619455300610,"dist-tags":{"latest":"2.0.3"}}