{"name":"inline-style-parser","version":"0.2.9","description":"An inline style parser.","main":"./cjs/index.js","module":"./esm/index.mjs","types":"./esm/index.d.mts","exports":{"import":{"types":"./esm/index.d.mts","default":"./esm/index.mjs"},"require":{"types":"./cjs/index.d.cts","default":"./cjs/index.js"}},"scripts":{"build":"run-s build:*","build:cjs":"rollup --config rollup.cjs.config.mjs --failAfterWarnings && cp index.d.ts cjs/index.d.cts","build:esm":"rollup --config rollup.esm.config.mjs --failAfterWarnings && cp index.d.ts esm/index.d.mts","build:umd":"rollup --config rollup.umd.config.mjs --failAfterWarnings","clean":"rm -rf cjs dist esm","lint":"eslint .","lint:fix":"npm run lint -- --fix","lint:package":"publint","prepare":"husky","prepublishOnly":"npm run lint && npm run build && npm test","test":"jest --colors --testPathIgnorePatterns=test/index.test.mjs","test:ci":"CI=true npm test -- --ci --coverage --collectCoverageFrom=cjs/index.js","test:esm":"node --test **/*.test.mjs","test:watch":"npm test -- --watch"},"repository":{"type":"git","url":"git+https://github.com/remarkablemark/inline-style-parser.git"},"bugs":{"url":"https://github.com/remarkablemark/inline-style-parser/issues"},"keywords":["inline-style-parser","inline-style","style","parser","css"],"devDependencies":{"@commitlint/cli":"21.2.0","@commitlint/config-conventional":"21.2.0","@eslint/js":"10.0.1","@rollup/plugin-commonjs":"29.0.3","@rollup/plugin-node-resolve":"16.0.3","@rollup/plugin-terser":"1.0.0","css":"3.0.0","eslint":"10.6.0","eslint-plugin-prettier":"5.5.6","eslint-plugin-simple-import-sort":"13.0.0","globals":"17.7.0","husky":"9.1.7","jest":"30.4.2","lint-staged":"17.0.8","npm-run-all":"4.1.5","prettier":"3.9.4","publint":"0.3.21","rollup":"4.62.2"},"license":"MIT","gitHead":"9ef0acd9cdb926363ec1cf9dcebde8ee216d1d07","_id":"inline-style-parser@0.2.9","homepage":"https://github.com/remarkablemark/inline-style-parser#readme","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-IttN8BqKLxzUrnTqHI+/hwAJQItBAUjdoHERCDv+oOuX48VP6bzW8+QjOXSfoevzq3YrYAwX1uLHp8TqO9yIeg==","shasum":"148d759a4b8677a560a1d3e185e6db7f6be57652","tarball":"http://registry-npm.ywwl.com/inline-style-parser/download/inline-style-parser-0.2.9.tgz","fileCount":14,"unpackedSize":62889,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/inline-style-parser@0.2.9","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCx3LWLQqn7vLPg9wWyHP8mpe2piGLypFx77B7LRIF73QIhAIZfHDEwnwzipWyZVVHtP7rLHRQxUMOQoJ2N7+JZgdKU"}],"size":10993,"noattachment":false,"key":"/inline-style-parser/-/inline-style-parser-0.2.9.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cb537887-38f3-4848-8d93-b827bfc0603d"}},"directories":{},"maintainers":[{"name":"remarkablemark","email":"mark@remarkablemark.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/inline-style-parser_0.2.9_1783315211545_0.8995105380872492"},"_hasShrinkwrap":false,"readme":"# inline-style-parser\n\n[![NPM](https://nodei.co/npm/inline-style-parser.png)](https://nodei.co/npm/inline-style-parser/)\n\n[![NPM version](https://img.shields.io/npm/v/inline-style-parser)](https://www.npmjs.com/package/inline-style-parser)\n[![NPM bundle size](https://img.shields.io/bundlephobia/minzip/inline-style-parser)](https://bundlephobia.com/package/inline-style-parser)\n[![build](https://github.com/remarkablemark/inline-style-parser/actions/workflows/build.yml/badge.svg)](https://github.com/remarkablemark/inline-style-parser/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/remarkablemark/inline-style-parser/branch/master/graph/badge.svg?token=B8EEK5709W)](https://codecov.io/gh/remarkablemark/inline-style-parser)\n[![NPM downloads](https://img.shields.io/npm/dm/inline-style-parser)](https://www.npmjs.com/package/inline-style-parser)\n\nInline style parser copied from [css/lib/parse/index.js](https://github.com/reworkcss/css/blob/v3.0.0/lib/parse/index.js):\n\n```\nInlineStyleParser(string)\n```\n\nExample:\n\n```js\nconst parse = require('inline-style-parser');\n\nparse('color: #BADA55;');\n```\n\nOutput:\n\n```js\n[ { type: 'declaration',\n    property: 'color',\n    value: '#BADA55',\n    position: Position { start: [Object], end: [Object], source: undefined } } ]\n```\n\n[JSFiddle](https://jsfiddle.net/remarkablemark/hcxbpwq8/) | [Examples](https://github.com/remarkablemark/inline-style-parser/tree/master/examples)\n\n## Installation\n\n[NPM](https://www.npmjs.com/package/inline-style-parser):\n\n```sh\nnpm install inline-style-parser --save\n```\n\n[Yarn](https://yarnpkg.com/package/inline-style-parser):\n\n```sh\nyarn add inline-style-parser\n```\n\n[CDN](https://unpkg.com/inline-style-parser/):\n\n```html\n<script src=\"https://unpkg.com/inline-style-parser@latest/dist/inline-style-parser.min.js\"></script>\n<script>\n  window.InlineStyleParser(/* string */);\n</script>\n```\n\n## Usage\n\nImport with ES Modules:\n\n```js\nimport parse from 'inline-style-parser';\n```\n\nOr require with CommonJS:\n\n```js\nconst parse = require('inline-style-parser');\n```\n\nParse single declaration:\n\n```js\nparse('left: 0');\n```\n\nOutput:\n\n```js\n[\n  {\n    type: 'declaration',\n    property: 'left',\n    value: '0',\n    position: {\n      start: { line: 1, column: 1 },\n      end: { line: 1, column: 8 },\n      source: undefined\n    }\n  }\n]\n```\n\nParse multiple declarations:\n\n```js\nparse('left: 0; right: 100px;');\n```\n\nOutput:\n\n```js\n[\n  {\n    type: 'declaration',\n    property: 'left',\n    value: '0',\n    position: {\n      start: { line: 1, column: 1 },\n      end: { line: 1, column: 8 },\n      source: undefined\n    }\n  },\n  {\n    type: 'declaration',\n    property: 'right',\n    value: '100px',\n    position: {\n      start: { line: 1, column: 10 },\n      end: { line: 1, column: 22 },\n      source: undefined\n    }\n  }\n]\n```\n\nParse declaration with missing value:\n\n```js\nparse('top:');\n```\n\nOutput:\n\n```js\n[\n  {\n    type: 'declaration',\n    property: 'top',\n    value: '',\n    position: {\n      start: { line: 1, column: 1 },\n      end: { line: 1, column: 5 },\n      source: undefined\n    }\n  }\n]\n```\n\nParse unknown declaration:\n\n```js\nparse('answer: 42;');\n```\n\nOutput:\n\n```js\n[\n  {\n    type: 'declaration',\n    property: 'answer',\n    value: '42',\n    position: {\n      start: { line: 1, column: 1 },\n      end: { line: 1, column: 11 },\n      source: undefined\n    }\n  }\n]\n```\n\nInvalid declarations:\n\n```js\nparse('');      // []\nparse();        // throws TypeError\nparse(1);       // throws TypeError\nparse('width'); // throws Error\nparse('/*');    // throws Error\n```\n\n## Testing\n\nRun tests:\n\n```sh\nnpm test\n```\n\nRun tests in watch mode:\n\n```sh\nnpm run test:watch\n```\n\nRun tests with coverage:\n\n```sh\nnpm run test:coverage\n```\n\nRun tests in CI mode:\n\n```sh\nnpm run test:ci\n```\n\nLint files:\n\n```sh\nnpm run lint\n```\n\nFix lint errors:\n\n```sh\nnpm run lint:fix\n```\n\n## Release\n\nRelease and publish are automated by [Release Please](https://github.com/googleapis/release-please).\n\n## License\n\n[MIT](https://github.com/remarkablemark/inline-style-parser/blob/master/LICENSE). See the [license](https://github.com/reworkcss/css/blob/v3.0.0/LICENSE) from the original project.\n","publish_time":1783315211679,"_cnpm_publish_time":1783315211679,"dist-tags":{"latest":"0.2.9"}}