{"id":21954182,"url":"https://github.com/cssobj/cssobj-converter","last_synced_at":"2025-04-23T09:58:37.093Z","repository":{"id":9796216,"uuid":"63371498","full_name":"cssobj/cssobj-converter","owner":"cssobj","description":"Convert from CSS to CSSOBJ.","archived":false,"fork":false,"pushed_at":"2023-01-11T18:51:58.000Z","size":402,"stargazers_count":5,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T09:58:30.037Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://convertcssobj-futurist.rhcloud.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cssobj.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-14T21:37:25.000Z","updated_at":"2024-01-01T04:47:57.000Z","dependencies_parsed_at":"2023-01-13T15:34:26.236Z","dependency_job_id":null,"html_url":"https://github.com/cssobj/cssobj-converter","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssobj%2Fcssobj-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssobj%2Fcssobj-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssobj%2Fcssobj-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssobj%2Fcssobj-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cssobj","download_url":"https://codeload.github.com/cssobj/cssobj-converter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250412544,"owners_count":21426285,"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":[],"created_at":"2024-11-29T07:16:56.316Z","updated_at":"2025-04-23T09:58:37.070Z","avatar_url":"https://github.com/cssobj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSSOBJ Converter\n\n[![Join the chat at https://gitter.im/css-in-js/cssobj](https://badges.gitter.im/css-in-js/cssobj.svg)](https://gitter.im/css-in-js/cssobj) [![Build Status](https://travis-ci.org/cssobj/cssobj-converter.svg?branch=master)](https://travis-ci.org/cssobj/cssobj-converter)\n\nConvert from normal css/LESS/SASS/SCSS to [cssobj](https://github.com/cssobj/cssobj).\n\nThe online version is below:\n\nhttp://convertcssobj-futurist.rhcloud.com/\n\n( Currently using [OpenShift](https://www.openshift.com/) free hosting for nodejs backend, it will sleep for some idle time.\n\nIf you cannot open the page, try again after few seconds, it will wake up.\n\nSomeone can help with this? Or provide a node js hosting? )\n\n## CLI\n\n### Install\n\n``` javascript\nnpm install -g cssobj-converter\n```\n\n### Usage\n\n``` bash\ncssobj [option] [cssfile]\n```\n\n### Option\n\noption | short | description\n---|---|---\n--output | -o | output file name(.js file)\n--pretty | -p | pretty format output js object **default: true**\n--css | -c | css code from command line\n--format | -f | supported: css,less,js. If **js** then convert from cssobj into css. **default: css**\n--watch | -w | watch [dir] for changes **default: false**\n--recursive | -r | recursive convert all [css/less] files in [dir]; **default: false**\n--keepVendor | -k | keep vendor prefix for css props\n--nameStore | -n | export nameStore as `classes`/`ids`, and js object as `obj`\n\nIf no `cssfile` and no `-c`, then cssobj will read from **STDIN**.\n\n### Example\n\n``` bash\n#read from stdin, (Ctrl+D) to convert\ncssobj\n\n#convert abc.css into cssobj, output to stdout\ncssobj abc.css\n\n#convert abc.css into cssobj, output to abc.js\ncssobj abc.css -o abc.js\n\n#convert abc.js into css then output\ncssobj -c '{p:{color: \"red\"}}' -f js\ncssobj abc.js -f js\n\n#convert abc.css into cssobj, output to abc.js, without pretty format\ncssobj abc.css -o abc.js -p false\n\n#convert less\ncssobj abc.less -f less -o abc.js\ncssobj abc.less -o abc.js  #same as above\n\n#convert css in command line\ncssobj -c \"p{ color:red; }\"\n\n# all files in folder convert to .js\ncssobj ./abc\n\n# convert all files in folder and watch\ncssobj ./abc -w\n\n# convert all files in folder and watch, result as {obj, ids, classes}\ncssobj ./abc -wn\n\n```\n\n## NodeJS\n\n### Install\n\n``` bash\nnpm install -S cssobj-converter\n```\n\n### Usage\n\n``` javascript\nvar converter = require('cssobj-converter')\nconsole.log( converter('p { color: red; }') )\n```\n\n## Server\n\nFrom the lib folder, `npm i` then run below script:\n\n``` bash\nnpm run server\n```\n\nService URL: `http://localhost:8080`\n\nAccept `POST` json data as below:\n\n``` bash\ncurl -d '{ \"text\" : \"p {color:red;}\" }' localhost:8080\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssobj%2Fcssobj-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcssobj%2Fcssobj-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssobj%2Fcssobj-converter/lists"}