{"id":17680732,"url":"https://github.com/kcreate/jsoncss","last_synced_at":"2025-03-30T19:13:02.359Z","repository":{"id":57285681,"uuid":"47879233","full_name":"KCreate/jsoncss","owner":"KCreate","description":"npm module that converts json to css","archived":false,"fork":false,"pushed_at":"2015-12-16T22:37:50.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T22:07:48.034Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/KCreate.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2015-12-12T13:28:22.000Z","updated_at":"2015-12-12T13:28:26.000Z","dependencies_parsed_at":"2022-09-19T22:42:08.479Z","dependency_job_id":null,"html_url":"https://github.com/KCreate/jsoncss","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KCreate%2Fjsoncss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KCreate%2Fjsoncss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KCreate%2Fjsoncss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KCreate%2Fjsoncss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KCreate","download_url":"https://codeload.github.com/KCreate/jsoncss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246365645,"owners_count":20765546,"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-10-24T09:08:43.042Z","updated_at":"2025-03-30T19:13:02.337Z","avatar_url":"https://github.com/KCreate.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jsoncss\nnpm module that converts json to css.\n\n# Why?\nYou could combine this with your build process so your server only sends down the needed css to the client. This reduces data usage enormously. For example, Facebook sends down so much css and only uses 10% of it. They could shave off 90% of their css and nobody would notice.\n\n# Usage\n```javascript\nvar jsoncss = require('jsoncss');\n```\n## Object to css\n```javascript\n// test object to css\njsoncss.convert({\n\t\"body\": {\n\t\t\"color\":\"red\"\n\t}\n}, '', function(err, result) {\n\tif (err) {\n\t\treturn console.log(err);\n\t}\n\tconsole.log(result);\n});\n```\n## JSON string\n```javascript\n// test json to css\njsoncss.convert('{\"body\":{\"color\":\"blue\"}}', '', function(err, result) {\n\tif (err) {\n\t\treturn console.log(err);\n\t}\n\tconsole.log(result);\n});\n```\n## File\n```javascript\n// test json-file to css\nvar fs\t\t\t= require('fs');\nfs.readFile('style.json', 'utf8', function(err,data) {\n\tif (err) {\n\t\treturn console.log(err);\n\t}\n\tvar conversion = jsoncss.convert(data, '', function(err, result){\n\t\tif (err) {\n\t\t\treturn console.log(err);\n\t\t}\n\t\tconsole.log(result);\n\t});\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcreate%2Fjsoncss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkcreate%2Fjsoncss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcreate%2Fjsoncss/lists"}