{"id":15486427,"url":"https://github.com/b-fuze/js2json","last_synced_at":"2026-04-30T13:31:32.299Z","repository":{"id":128002291,"uuid":"125686504","full_name":"b-fuze/js2json","owner":"b-fuze","description":"CSS or Javascript Object Literal to JSON (No Regex)","archived":false,"fork":false,"pushed_at":"2018-03-19T18:48:41.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-29T04:43:38.412Z","etag":null,"topics":["javascript","json","parser"],"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/b-fuze.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":"2018-03-18T02:35:16.000Z","updated_at":"2024-04-22T12:29:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"47b38856-b74a-42bf-b8ba-b290b466a982","html_url":"https://github.com/b-fuze/js2json","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"c0bda2f8281cc83f892e512a1a98d34644eb683d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/b-fuze/js2json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-fuze%2Fjs2json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-fuze%2Fjs2json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-fuze%2Fjs2json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-fuze%2Fjs2json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b-fuze","download_url":"https://codeload.github.com/b-fuze/js2json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-fuze%2Fjs2json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32466333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["javascript","json","parser"],"created_at":"2024-10-02T06:08:22.903Z","updated_at":"2026-04-30T13:31:32.275Z","avatar_url":"https://github.com/b-fuze.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# js2json\nWill convert your CSS or your Javascript literal to JSON while attempting to preserve the majority of the original string, with a minimalistic parser (no regex)\n\n## Usage\nIn JS\n```js\nconst json = js2json(jsObjectLiteralString, stringifyValues, propertyDelimeter, transformDelimeter);\n```\n\nCLI Usage\n```shell\njson2json.js [-c|--css] [-s|--stringify-values]\n```\n\nExample\n```shell\necho '{error: \"Invalid timestamp\"}' | ./js2json.js\n# output: {\"error\": \"Invalid timestamp\"}\n```\n\nExample:\n```js\n  {\n    str: true,\n    more: 10000,\n    \"lol \\\" what\": 10,\n    go: false,\n    \"g-\u003c\": {\n        prop1: null,\n        nothing: 1\n    },\n    noMore: \"props and stuff \\' \\\\\",\n    stuff: -1100,\n    propsFam: {\n      \"depth\": null,\n      reckless: \"behaviour\"\n    }\n  }\n```\nBecomes\n```js\n  {\n    \"str\": true,\n    \"more\": 10000,\n    \"lol \\\" what\": 10,\n    \"go\": false,\n    \"g-\u003c\": {\n        \"prop1\": null,\n        \"nothing\": 1\n    },\n    \"noMore\": \"props and stuff \\' \\\\\",\n    \"stuff\": -1100,\n    \"propsFam\": {\n      \"depth\": null,\n      \"reckless\": \"behaviour\"\n    }\n  }\n```\nIt will also be wary of (double) quoted properties; it will leave them as-is because they're already valid JSON properies.\n\n## Why not eval(...)?\nBecause using `eval(...)` can potentially produce undefined behaviour in your program, not to mention security issues, you should avoid defaulting to `eval` and instead produce valid JSON to go through `JSON.parse(...)`\n\n## Known Issues\n - Assumes all quoted strings uses double quotes\n - Assumes the provided literal is syntactically correct\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-fuze%2Fjs2json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb-fuze%2Fjs2json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-fuze%2Fjs2json/lists"}