{"name":"inline-style-parser","version":"0.1.2","description":"An inline style parser.","main":"index.js","scripts":{"build":"rollup --config --failAfterWarnings","clean":"rm -rf dist","coveralls":"cat coverage/lcov.info | coveralls","lint":"eslint --ignore-path .gitignore .","lint:fix":"npm run lint -- --fix","prepublishOnly":"pinst --disable && npm run lint && npm test && npm run build","test":"jest","test:ci":"npm run test:coverage -- --ci","test:coverage":"jest --coverage --collectCoverageFrom=index.js","test:watch":"jest --watch","_postinstall":"husky install","postpublish":"pinst --enable"},"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":"17.8.0","@commitlint/config-conventional":"17.8.0","@rollup/plugin-commonjs":"25.0.5","@rollup/plugin-terser":"0.4.4","coveralls":"3.1.1","css":"3.0.0","eslint":"8.51.0","eslint-plugin-prettier":"5.0.1","husky":"8.0.3","jest":"29.7.0","lint-staged":"14.0.0","pinst":"3.0.0","prettier":"3.0.3","rollup":"4.1.0"},"license":"MIT","_id":"inline-style-parser@0.1.2","gitHead":"75f77f11947c65ef3bfdc140c9d45c8446103367","homepage":"https://github.com/remarkablemark/inline-style-parser#readme","_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-LIgOVcBqf9qOWw7upN2DSbKS7EWRgDsmzRuWjiRq9jbeRgbsn0RRSmc+xDwD5KddXaD6TZnObpqBBfiFmU4y+A==","shasum":"2eb74c5a86840a4b61f033fdba57cf7156318303","tarball":"http://registry-npm.ywwl.com/inline-style-parser/download/inline-style-parser-0.1.2.tgz","fileCount":7,"unpackedSize":37852,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAO9xkAhWUE5HZ6qv7Kc1+0c5dwBNTrocDge0tCvUEbdAiB39fgLOrhWUCFH+DBd4Zg1jGPBoJAn4THwMGPgyE2Pkg=="}],"size":8724,"noattachment":false,"key":"/inline-style-parser/-/inline-style-parser-0.1.2.tgz"},"_npmUser":{"name":"remarkablemark","email":"mark@remarkablemark.org"},"directories":{},"maintainers":[{"name":"remarkablemark","email":"mark@remarkablemark.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/inline-style-parser_0.1.2_1697325642179_0.790037701450724"},"_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://badgen.net/npm/v/inline-style-parser)](https://www.npmjs.com/package/inline-style-parser)\n[![Bundlephobia minified + gzip](https://badgen.net/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://badgen.net/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/v2.2.4/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/) | [Replit](https://replit.com/@remarkablemark/inline-style-parser) | [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/v2.2.4/LICENSE) from the original project.\n","publish_time":1697325642374,"_cnpm_publish_time":1697325642374,"dist-tags":{"latest":"0.2.9"}}