{"id":18950433,"url":"https://github.com/nkt/css-variables-parser","last_synced_at":"2025-04-16T00:31:42.660Z","repository":{"id":17285676,"uuid":"81617894","full_name":"nkt/css-variables-parser","owner":"nkt","description":"CSS variables parser","archived":false,"fork":false,"pushed_at":"2023-03-04T04:25:54.000Z","size":295,"stargazers_count":8,"open_issues_count":4,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-29T04:51:12.659Z","etag":null,"topics":["css-variables","parser","postcss"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nkt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-11T00:01:54.000Z","updated_at":"2024-02-24T12:03:20.000Z","dependencies_parsed_at":"2024-06-19T05:21:56.859Z","dependency_job_id":"49c3a6a7-facf-49f7-ad72-82ee018e09e5","html_url":"https://github.com/nkt/css-variables-parser","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkt%2Fcss-variables-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkt%2Fcss-variables-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkt%2Fcss-variables-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkt%2Fcss-variables-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nkt","download_url":"https://codeload.github.com/nkt/css-variables-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248657869,"owners_count":21140844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css-variables","parser","postcss"],"created_at":"2024-11-08T13:22:58.435Z","updated_at":"2025-04-16T00:31:42.392Z","avatar_url":"https://github.com/nkt.png","language":"JavaScript","readme":"CSS Variables Parser\n====================\n\n[![Build Status](https://circleci.com/gh/nkt/css-variables-parser.svg?style=shield)](https://circleci.com/gh/nkt/css-variables-parser)\n\nInstallation\n------------\n\n```bash\nnpm install css-variables-parser\n```\n\nUsage\n-----\n\nParse css string\n\n```js\nconst { parse } = require('css-variables-parser');\n\nconst variables = parse(':root { --color-primary: red; }');\nconsole.log(variables); // { 'color-primary': 'red' }\n```\n\nParse file (not available in browser)\n\n```js\nconst {\n  parseFile,\n  parseFileSync,\n  parseFileAsync\n} = require('css-variables-parser');\n\nparseFile('./path/to/file.css', null, (error, variables) =\u003e {\n  console.log({ error, variables });\n});\n\nconst variables = parseFileSync('./path/to/file.css');\n\nparseFileAsync('./path/to/file.css')\n  .then((variables) =\u003e console.log(variables))\n  .catch((error) =\u003e console.error(error));\n```\n\nThere are some options:\n\n```js\nconst parser = require('css-variables-parser');\n\nconst variables = parser.parse(css, {\n  from: 'filename.css',\n  parser: require('sugarss')\n});\n```\n\nLicense\n-------\n\n[MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkt%2Fcss-variables-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnkt%2Fcss-variables-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkt%2Fcss-variables-parser/lists"}