{"name":"inline-style-parser","version":"0.2.6","keywords":["inline-style-parser","inline-style","style","parser","css"],"license":"MIT","_id":"inline-style-parser@0.2.6","maintainers":[{"name":"remarkablemark","email":"mark@remarkablemark.org"}],"homepage":"https://github.com/remarkablemark/inline-style-parser#readme","bugs":{"url":"https://github.com/remarkablemark/inline-style-parser/issues"},"dist":{"shasum":"e6bbb5288a635f6284a6249ce754da55c4bd1ff5","tarball":"http://registry-npm.ywwl.com/inline-style-parser/download/inline-style-parser-0.2.6.tgz","fileCount":14,"integrity":"sha512-gtGXVaBdl5mAes3rPcMedEBm12ibjt1kDMFfheul1wUAOVEJW60voNdMVzVkfLN06O7ZaD/rxhfKgtlgtTbMjg==","signatures":[{"sig":"MEYCIQC29PqgXbexPIY8BS3eYwmLCWXMYNd6ktOojQI/ej4/AAIhAJghDmSfy9SeKVFYlB96TfqdOLTuHvU7RWXSj19QkAf1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/inline-style-parser@0.2.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":66560,"size":11514,"noattachment":false,"key":"/inline-style-parser/-/inline-style-parser-0.2.6.tgz"},"main":"./cjs/index.js","types":"./esm/index.d.mts","module":"./esm/index.mjs","exports":{"import":{"types":"./esm/index.d.mts","default":"./esm/index.mjs"},"require":{"types":"./cjs/index.d.cts","default":"./cjs/index.js"}},"gitHead":"1daaab472448bf481e448a59d745a9ae63daff0b","scripts":{"lint":"eslint .","test":"jest --colors --testPathIgnorePatterns=test/index.test.mjs","build":"run-s build:*","clean":"rm -rf cjs dist esm","prepare":"husky","test:ci":"CI=true npm test -- --ci --coverage --collectCoverageFrom=cjs/index.js","lint:fix":"npm run lint -- --fix","test:esm":"node --test **/*.test.mjs","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","test:watch":"npm test -- --watch","lint:package":"publint","prepublishOnly":"npm run lint && npm run build && npm test"},"_npmUser":{"name":"remarkablemark","email":"mark@remarkablemark.org"},"repository":{"url":"git+https://github.com/remarkablemark/inline-style-parser.git","type":"git"},"_npmVersion":"11.6.0","description":"An inline style parser.","directories":{},"_nodeVersion":"24.9.0","_hasShrinkwrap":false,"devDependencies":{"css":"3.0.0","jest":"30.2.0","husky":"9.1.7","eslint":"9.36.0","rollup":"4.52.4","globals":"16.4.0","publint":"0.3.13","prettier":"3.6.2","@eslint/js":"9.36.0","lint-staged":"16.2.3","npm-run-all":"4.1.5","@eslint/compat":"1.4.0","@commitlint/cli":"20.1.0","@eslint/eslintrc":"3.3.1","@rollup/plugin-terser":"0.4.4","eslint-plugin-prettier":"5.5.4","@rollup/plugin-commonjs":"28.0.6","@rollup/plugin-node-resolve":"16.0.1","@commitlint/config-conventional":"20.0.0","eslint-plugin-simple-import-sort":"12.1.1"},"_npmOperationalInternal":{"tmp":"tmp/inline-style-parser_0.2.6_1759513323841_0.0003927780625403443","host":"s3://npm-registry-packages-npm-production"},"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":1759513324033,"_cnpm_publish_time":1759513324033,"dist-tags":{"latest":"0.2.9"}}