{"id":15870260,"url":"https://github.com/davidedaniel/convert-css","last_synced_at":"2026-05-09T10:32:55.879Z","repository":{"id":84159101,"uuid":"99091305","full_name":"DavideDaniel/convert-css","owner":"DavideDaniel","description":"Convert css into different formats (cssToJson, camelizedJson etc)","archived":false,"fork":false,"pushed_at":"2017-08-05T18:40:18.000Z","size":10,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T14:18:35.797Z","etag":null,"topics":["css","css-in-js","css-parse","css-to-js","react"],"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/DavideDaniel.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-08-02T08:21:36.000Z","updated_at":"2017-08-05T18:03:48.000Z","dependencies_parsed_at":"2023-03-01T08:00:17.877Z","dependency_job_id":null,"html_url":"https://github.com/DavideDaniel/convert-css","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":0.3846153846153846,"last_synced_commit":"c515b611c638a251a3c33b7973f020fa865e6698"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavideDaniel%2Fconvert-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavideDaniel%2Fconvert-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavideDaniel%2Fconvert-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavideDaniel%2Fconvert-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavideDaniel","download_url":"https://codeload.github.com/DavideDaniel/convert-css/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246716701,"owners_count":20822503,"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","css-in-js","css-parse","css-to-js","react"],"created_at":"2024-10-06T00:05:18.310Z","updated_at":"2026-05-09T10:32:50.850Z","avatar_url":"https://github.com/DavideDaniel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/DavideDaniel/convert-css.svg?branch=master)](https://travis-ci.org/DavideDaniel/convert-css)\n\n# convert-css\n\nParse and convert css. The focus is on JSON as it's needed for other services, and other easier conversions like modules in js for css-in-js.\n\n### Install\n\n`$ npm install convert-css --save`\n\n### Usage\n\n```javascript\nconst fs = require('fs');\nconst { cssToCamelizedJson } = require('convert-css');\n\nconst handleErr = (err) =\u003e {\n  if(err) {\n    console.error(err);\n  }\n};\n\nfs.readFile('./my.css', 'utf-8', (err, data) =\u003e {\n  handleErr(err);\n\n  const cssText = data.toString();\n  const cssInJs = 'module.exports = ' + JSON.stringify(\n    cssToCamelizedJson(data), null, 2\n  );\n\n  fs.writeFile('./myCss.js', Buffer.from(cssInJs), (error) =\u003e {\n    handleErr(error)\n    console.log('done!')\n  });\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidedaniel%2Fconvert-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidedaniel%2Fconvert-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidedaniel%2Fconvert-css/lists"}