{"_id":"css-tokenize","_rev":"6-93cd7f87793862f2c3956f2533a6d3cf","name":"css-tokenize","description":"Transform stream that tokenizes CSS","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"css-tokenize","version":"1.0.0","description":"Transform stream that tokenizes CSS","main":"index.js","scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"https://github.com/anandthakker/css-tokenize.git"},"keywords":["css","tokenize","parse","stream","streaming"],"author":{"name":"Anand Thakker","email":"vestibule@anandthakker.net","url":"http://anandthakker.net"},"license":"MIT","bugs":{"url":"https://github.com/anandthakker/css-tokenize/issues"},"homepage":"https://github.com/anandthakker/css-tokenize","devDependencies":{"tape":"^3.0.3","through2":"^0.6.3"},"dependencies":{"inherits":"^2.0.1","readable-stream":"^1.0.33"},"gitHead":"936d8151aa03945e22230ecbf51a4468fd0624c3","_id":"css-tokenize@1.0.0","_shasum":"805ec0a83b3c1806eef338669761e47d640c6bf0","_from":".","_npmVersion":"2.1.8","_nodeVersion":"0.11.14","_npmUser":{"name":"anandthakker","email":"vestibule@anandthakker.net"},"maintainers":[{"name":"anandthakker","email":"vestibule@anandthakker.net"}],"dist":{"shasum":"805ec0a83b3c1806eef338669761e47d640c6bf0","tarball":"https://registry.npmjs.org/css-tokenize/-/css-tokenize-1.0.0.tgz","integrity":"sha512-CgRs15lyU2qEQd/cefpDqFBVjIYyZi7gdxBHXF6grHrPdJYbP1u8Dml/ufyQIBVDmUaViXMMptp/qROecVi2yg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyqDiEtPYzMaoCKZ/3ORzyS68lm9J4f2RCgNS7XWnLggIhAOAu6VR4hwsSOxOVSKZj+Ike+oM8kiR5dEnyCe3/uyyc"}]}},"1.0.1":{"name":"css-tokenize","version":"1.0.1","description":"Transform stream that tokenizes CSS","main":"index.js","scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"https://github.com/anandthakker/css-tokenize.git"},"keywords":["css","tokenize","parse","stream","streaming"],"author":{"name":"Anand Thakker","email":"vestibule@anandthakker.net","url":"http://anandthakker.net"},"license":"MIT","bugs":{"url":"https://github.com/anandthakker/css-tokenize/issues"},"homepage":"https://github.com/anandthakker/css-tokenize","devDependencies":{"tape":"^3.0.3","through2":"^0.6.3"},"dependencies":{"inherits":"^2.0.1","readable-stream":"^1.0.33"},"gitHead":"d4acf6d2010cbbb61f69817f53b249471468d7a9","_id":"css-tokenize@1.0.1","_shasum":"4625cb1eda21c143858b7f81d6803c1d26fc14be","_from":".","_npmVersion":"2.1.8","_nodeVersion":"0.11.14","_npmUser":{"name":"anandthakker","email":"vestibule@anandthakker.net"},"maintainers":[{"name":"anandthakker","email":"vestibule@anandthakker.net"}],"dist":{"shasum":"4625cb1eda21c143858b7f81d6803c1d26fc14be","tarball":"https://registry.npmjs.org/css-tokenize/-/css-tokenize-1.0.1.tgz","integrity":"sha512-gLmmbJdwH9HLY4bcA17lnZ8GgPwEXRbvxBJGHnkiB6gLhRpTzjkjtMIvz7YORGW/Ptv2oMk8b5g+u7mRD6Dd7A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGoXaOnbzELSP7xKac8AOEZWAiwJvf+qs/PPvAYs5f/9AiEAnK1jtqcn7/lrLTqIYW/Ps5LuXt7rrZI+bf1TKR6bDCQ="}]}}},"readme":"css-tokenize\n============\n\nCoarsely tokenize a stream of CSS, largely modeled after \n[substack/html-tokenize](/substack/html-tokenize).\n\n```javascript\nvar tokenize = require('css-tokenize'),\nthrough = require('through2');\n\nprocess.stdin\n.pipe(tokenize())\n.pipe(through.obj(function(token, enc, next) {\n  token[1] = token[1].toString(); // it's a buffer slice\n  console.log('TOKEN', token);\n  next();\n}))\n```\n\nInput:\n```css\n\ndiv {\n  background: red;\n}\n\n.cls {\n  color: green;\n}\n\n#id {\n  font-size: 10px;\n}\n\n/* comment */\n\n@media screen and (min-width: 1000px) {\n  a {\n    text-decoration: underline;\n  }\n}\n\na:hover {\n  font-weight: bold;  \n}\n\nsection \n\n\n{\n  margin: 0;\n  /* comment wthin a rule */\n  padding: 5px;\n}\n\n\nbody > * {\n  \n}\n```\n\nOutput:\n```\nTOKEN [ 'root', '\\n' ]\nTOKEN [ 'rule_start', 'div {' ]\nTOKEN [ 'rule', '\\n  background: red;\\n' ]\nTOKEN [ 'rule_end', '}' ]\nTOKEN [ 'root', '\\n\\n' ]\nTOKEN [ 'rule_start', '.cls {' ]\nTOKEN [ 'rule', '\\n  color: green;\\n' ]\nTOKEN [ 'rule_end', '}' ]\nTOKEN [ 'root', '\\n\\n' ]\nTOKEN [ 'rule_start', '#id {' ]\nTOKEN [ 'rule', '\\n  font-size: 10px;\\n' ]\nTOKEN [ 'rule_end', '}' ]\nTOKEN [ 'comment', '\\n\\n/* comment */' ]\nTOKEN [ 'space', '\\n\\n' ]\nTOKEN [ 'atrule_start', '@media screen and (min-width: 1000px) {' ]\nTOKEN [ 'atrule', '\\n  ' ]\nTOKEN [ 'rule_start', 'a {' ]\nTOKEN [ 'rule', '\\n    text-decoration: underline;\\n  ' ]\nTOKEN [ 'rule_end', '}' ]\nTOKEN [ 'atrule', '\\n' ]\nTOKEN [ 'atrule_end', '}' ]\nTOKEN [ 'root', '\\n\\n' ]\nTOKEN [ 'rule_start', 'a:hover {' ]\nTOKEN [ 'rule', '\\n  font-weight: bold;  \\n' ]\nTOKEN [ 'rule_end', '}' ]\nTOKEN [ 'root', '\\n\\n' ]\nTOKEN [ 'rule_start', 'section \\n\\n\\n{' ]\nTOKEN [ 'rule', '\\n  margin: 0;\\n  ' ]\nTOKEN [ 'comment', '/* comment wthin a rule */' ]\nTOKEN [ 'rule', '\\n  padding: 5px;\\n' ]\nTOKEN [ 'rule_end', '}' ]\nTOKEN [ 'root', '\\n\\n\\n' ]\nTOKEN [ 'rule_start', 'body > * {' ]\nTOKEN [ 'rule', '\\n  \\n' ]\nTOKEN [ 'rule_end', '}' ]\nTOKEN [ 'root', '\\n' ]\n```\n","maintainers":[{"name":"anandthakker","email":"vestibule@anandthakker.net"}],"time":{"modified":"2022-06-14T04:54:22.502Z","created":"2014-12-21T16:21:18.007Z","1.0.0":"2014-12-21T16:21:18.007Z","1.0.1":"2014-12-21T21:26:24.466Z"},"homepage":"https://github.com/anandthakker/css-tokenize","keywords":["css","tokenize","parse","stream","streaming"],"repository":{"type":"git","url":"https://github.com/anandthakker/css-tokenize.git"},"author":{"name":"Anand Thakker","email":"vestibule@anandthakker.net","url":"http://anandthakker.net"},"bugs":{"url":"https://github.com/anandthakker/css-tokenize/issues"},"license":"MIT","readmeFilename":"README.md"}