{"id":34278837,"url":"https://github.com/tom-konda/cty2json","last_synced_at":"2026-04-07T06:32:47.575Z","repository":{"id":23656936,"uuid":"27027616","full_name":"tom-konda/cty2json","owner":"tom-konda","description":"This JavaScript library converts from .cty file ( Micropolis format ) to JSON.","archived":false,"fork":false,"pushed_at":"2025-01-02T03:38:26.000Z","size":870,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-20T10:39:09.767Z","etag":null,"topics":["cli","cty","javascript","json","library"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tom-konda.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}},"created_at":"2014-11-23T09:25:32.000Z","updated_at":"2025-01-02T03:38:30.000Z","dependencies_parsed_at":"2023-11-10T19:35:25.271Z","dependency_job_id":null,"html_url":"https://github.com/tom-konda/cty2json","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/tom-konda/cty2json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-konda%2Fcty2json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-konda%2Fcty2json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-konda%2Fcty2json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-konda%2Fcty2json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tom-konda","download_url":"https://codeload.github.com/tom-konda/cty2json/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-konda%2Fcty2json/sbom","scorecard":{"id":891796,"data":{"date":"2025-08-11","repo":{"name":"github.com/tom-konda/cty2json","commit":"ed2ec88c394b6fe7fb49051939f2f68058c0930b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build_tests.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/tom-konda/cty2json/build_tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build_tests.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/tom-konda/cty2json/build_tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build_tests.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/tom-konda/cty2json/build_tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build_tests.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/tom-konda/cty2json/build_tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build_tests.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/tom-konda/cty2json/build_tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build_tests.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/tom-konda/cty2json/build_tests.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/build_tests.yml:15","Warn: npmCommand not pinned by hash: .github/workflows/build_tests.yml:26","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build_tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-vg6x-rcgg-rjx6","Warn: Project is vulnerable to: GHSA-x574-m823-4x7w","Warn: Project is vulnerable to: GHSA-4r4m-qw57-chr8","Warn: Project is vulnerable to: GHSA-xcj6-pq6g-qj4x","Warn: Project is vulnerable to: GHSA-356w-63v5-8wf4","Warn: Project is vulnerable to: GHSA-859w-5945-r5v3","Warn: Project is vulnerable to: GHSA-9crc-q9x8-hgqq"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T12:07:58.467Z","repository_id":23656936,"created_at":"2025-08-24T12:07:58.468Z","updated_at":"2025-08-24T12:07:58.468Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31503382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["cli","cty","javascript","json","library"],"created_at":"2025-12-16T22:12:05.157Z","updated_at":"2026-04-07T06:32:47.569Z","avatar_url":"https://github.com/tom-konda.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Cty2JSON: https://github.com/tom-konda/cty2json\n\n[![Build Status](https://travis-ci.org/tom-konda/cty2json.svg?branch=master)](https://travis-ci.org/tom-konda/cty2json)\n\n\n## About\nThis JavaScript library converts from .cty file (Micropolis format) to JSON.\n\n## Support Browsers\n- Firefox, Google Chrome\n- MS Edge, Safari works probabry.\n\n\n## Support Node.js versions\n\n* Latest LTS\n\n## Usage\n### CLI\n```bash\n$ cty2json [options] \u003cinputFile\u003e\n```\n\nOptions\n\n```bash\n    -h, --help                 output usage information\n    -v, --version              output the version number\n    -o, --output \u003coutputFile\u003e  Output JSON file\n```\n\n### Library\n#### Browser (Legacy Style)\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eDemo\u003c/title\u003e\n    \u003cscript src=\"../../lib/cty2json.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n      'use strict';\n      let xhr = new win.XMLHttpRequest();\n\n      xhr.onreadystatechange = function() {\n        if (xhr.readyState == 4) {\n          let json = Cty2JSON.analyze(xhr.response);\n          let cityData = JSON.parse(json);\n        }\n      }\n\n      xhr.open('GET', dataURLSch);\n      xhr.responseType = 'arraybuffer';\n      xhr.send();\n    \u003c/script\u003e\n  \u003c/head\u003e\n\u003c/html\u003e\n```\n\n#### Browser (ES Modules)\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n  \u003cscript type=\"module\"\u003e\n    import cty2JSON from './cty2json.js';\n    \n    fetch('./cty2jsonTest.cty')\n    .then(\n      (result) =\u003e {\n        return result.arrayBuffer();\n      }\n    ).then(\n      (buffer) =\u003e {\n        const cityData = cty2JSON.analyze(buffer);\n      }\n    );\n  \u003c/script\u003e\n\u003c/head\u003e\n\u003c/html\u003e\n```\n\n#### Web worker\n\n```js\nimportScripts('../../lib/cty2json.js');\n\nself.addEventListener(\n    'message',\n    function(event){\n        let cityData = event.data;\n        self.postMessage(self.Cty2JSON.analyze(cityData));\n        self.close();\n    },\n    false\n);\n```\n\n#### Node.js\n\n```js\nconst Cty2JSON = require('../../cty2json');\n\nlet file = fs.readFileSync(`PATH_TO_CTYFILE/test.cty`);\n\n// Convert from buffer to Uint8Array\nlet uint8arr = new Uint8Array(file);\nlet json = Cty2JSON.analyze(uint8arr.buffer);\n```\n\n## Output Format\n```\n{\n  fileSize : Integer,\n  historyData : {\n    residential: {\n      \"10years\": [\n        0-255, // 120 items\n      ],\n      \"120years\": [\n        0-255, // 120 items\n      ],\n    },\n    commercial: {\n      \"10years\": [\n        0-255, // 120 items\n      ],\n      \"120years\": [\n        0-255, // 120 items\n      ],\n    },\n    industrial: {\n      \"10years\": [\n        0-255, // 120 items\n      ],\n      \"120years\": [\n        0-255, // 120 items\n      ],\n    },\n    crime: {\n      \"10years\": [\n        0-255, // 120 items\n      ],\n      \"120years\": [\n        0-255, // 120 items\n      ],\n    },\n    pollution: {\n      \"10years\": [\n        0-255, // 120 items\n      ],\n      \"120years\": [\n        0-255, // 120 items\n      ],\n    },\n    landValue: {\n      \"10years\": [\n        0-255, // 120 items\n      ],\n      \"120years\": [\n        0-255, // 120 items\n      ],\n    },\n  },\n  miscData : {\n    CPopulation : Integer,\n    CValve : Integer,\n    IPopulation : Integer,\n    IValve : Integer,\n    RPopulation : Integer,\n    RValve : Integer,\n    autoBudget : 0 or 1,\n    autoBulldoze : 0 or 1,\n    autoGoto : 0 or 1,\n    budget : 0 or 1,\n    cityClass : Integer,\n    cityScore : Integer,\n    cityTime : Integer,\n    crimeAve : Integer,\n    crimeRamp : Integer,\n    fireCovered : 0-65536,\n    gameLevel : 0-2,\n    gameSpeed : 0-4,\n    landValueAve : Integer,\n    policeCovered : 0-65536,\n    polluteRamp : Integer,\n    pollutionAve : Integer,\n    transportCovered : 0-65536,\n    soundOn : 0 or 1,\n    tax : 0-20\n  },\n  tileDatas : [\n    [\n      {\n        building : 0-1023,\n        animated : Boolean,\n        bulldozable : Boolean,\n        combustible : Boolean,\n        conductive : Boolean,\n        zoneCenter : Boolean,\n      }, {\n      }, // 120 items\n    ], [\n    ], // 100 items\n  ], \n}\n```\n\n## How to build\n\n1. Clone the repo from github `git clone https://github.com/tom-konda/cty2json.git` \n2. Change current directory `cd cty2json` \n3. Run `npm install`\n4. Run `npm run build`\n\n## License\nLicensed under the GPLv3\n\n## Acknowledgement\n\n- [MicropolisJ](https://github.com/jason17055/micropolis-java) for help to understand .cty file format.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-konda%2Fcty2json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftom-konda%2Fcty2json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-konda%2Fcty2json/lists"}