{"id":42013073,"url":"https://github.com/tom-konda/sc2ktojson","last_synced_at":"2026-01-26T02:44:50.435Z","repository":{"id":31651896,"uuid":"128138888","full_name":"tom-konda/sc2ktojson","owner":"tom-konda","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-02T16:27:19.000Z","size":774,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T23:55:11.716Z","etag":null,"topics":["cli","javascript","json","sc2","sc2k","scn"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-05T00:15:50.000Z","updated_at":"2025-01-02T16:27:23.000Z","dependencies_parsed_at":"2024-09-14T04:18:13.940Z","dependency_job_id":"c49aa051-0478-45b5-b208-c993923def03","html_url":"https://github.com/tom-konda/sc2ktojson","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tom-konda/sc2ktojson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-konda%2Fsc2ktojson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-konda%2Fsc2ktojson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-konda%2Fsc2ktojson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-konda%2Fsc2ktojson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tom-konda","download_url":"https://codeload.github.com/tom-konda/sc2ktojson/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-konda%2Fsc2ktojson/sbom","scorecard":{"id":891797,"data":{"date":"2025-08-11","repo":{"name":"github.com/tom-konda/sc2ktojson","commit":"90083e4010e4396b2031c4374e3cc7bc0fd36385"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"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":"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":"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":"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":"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":"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":"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":"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:21: update your workflow using https://app.stepsecurity.io/secureworkflow/tom-konda/sc2ktojson/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/sc2ktojson/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/sc2ktojson/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/sc2ktojson/build_tests.yml/main?enable=pin","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/sc2ktojson/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/sc2ktojson/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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: 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":"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":"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":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","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:08:00.017Z","repository_id":31651896,"created_at":"2025-08-24T12:08:00.017Z","updated_at":"2025-08-24T12:08:00.017Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28765343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T02:25:41.078Z","status":"ssl_error","status_checked_at":"2026-01-26T02:24:28.809Z","response_time":59,"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","javascript","json","sc2","sc2k","scn"],"created_at":"2026-01-26T02:44:49.589Z","updated_at":"2026-01-26T02:44:50.429Z","avatar_url":"https://github.com/tom-konda.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About\nThis JavaScript library converts from .sc2 (SC2K city file) or .scn (SC2K scenario file) file to JSON.\n\n## Support Browsers\n* Firefox, Google Chrome\n* MS Edge, Safari works probabry.\n\n## Usage\n### CLI\n```bash\n$ sc2ktojson [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:browser.html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eDemo\u003c/title\u003e\n    \u003cscript src=\"../../lib/sc2ktojson.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n      'use strict';\n      let xhr = new win.XMLHttpRequest();\n      const sc2fileURL = './sc2ktojsonTest.sc2';\n\n      xhr.onreadystatechange = function() {\n        if (xhr.readyState == 4) {\n          let cityData = sc2ktojson.analyze(xhr.response);\n        }\n      }\n\n      xhr.open('GET', sc2fileURL);\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:es_modules.html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n  \u003cscript type=\"module\"\u003e\n    import sc2ktojson from './sc2ktojson.js';\n    \n    fetch('./sc2ktojsonTest.sc2')\n    .then(\n      (result) =\u003e {\n        return result.arrayBuffer();\n      }\n    ).then(\n      (buffer) =\u003e {\n        const cityData = sc2ktojson.analyze(buffer);\n      }\n    );\n  \u003c/script\u003e\n\u003c/head\u003e\n\u003c/html\u003e\n```\n\n#### Web worker\n\n```js:worker.js\nimportScripts('../../lib/sc2ktojson.js');\n\nself.addEventListener(\n    'message',\n    function(event){\n        let cityData = event.data;\n        self.postMessage(self.sc2ktojson.analyze(cityData));\n        self.close();\n    },\n    false\n);\n```\n\n#### Node.js\n\n```js:node.js\nconst sc2ktojson = require('../../sc2ktojson');\n\nlet file = fs.readFileSync(`PATH_TO_SCNFILE/test.scn`);\n\n// Convert from buffer to Uint8Array\nlet uint8arr = new Uint8Array(file);\nlet cityData = sc2ktojson.analyze(uint8arr.buffer);\n```\n\n## Output Format\n\n```\n{\n  scenario : {\n    tmpl : [0-255, 0-255, ...], // optional, arbitrary items\n    text : {\n      opening : [0-255, 0-255, ...], // scenario opening text. arbitrary items\n      selection : [0-255, 0-255, ...], // scenario selection text. arbitrary items\n    },\n    scen : {\n      disaster : integer,\n      disasterCoordinate : {\n        x : integer,\n        y : integer,\n      },\n      limit : integer,\n      condPop : integer,\n      condRPop : integer,\n      condCPop : integer,\n      condIPop : integer,\n      condFund : integer,\n      condVal : integer,\n      condEdu : integer,\n      condPol : integer,\n      condCri : integer,\n      condTra : integer,\n      condBld1ID : integer,\n      condBld2ID : integer,\n      condBld1Tiles : integer,\n      condBld2Tiles : integer,\n    },\n    pict : {\n      width : integer,\n      height : integer,\n      picture : [\n        [0-255, 0-255, ...], // same as width\n      ], // same as height\n    }\n  }, // optional, .scn file only\n  tile : {\n    altm : [\n      [\n        {\n          isWater : 0-1,\n          height : 0-31,\n          binaryText: string,\n        }, ...\n      ], // 128 items\n    ], // 128 items\n    xter : [\n      [0-255, 0-255, ...], // 128 items\n    ], // 128 items\n    xbld : [\n      [0-255, 0-255, ...], // 128 items\n    ], // 128 items\n    xzon : [\n      [\n        {\n          zone: 0-15,\n          binaryText: string,\n        },\n      ], // 128 items\n    ], // 128 items,\n    xund : [\n      [0-255, 0-255, ...], // 128 items\n    ], // 128 items\n    xtxt : [\n      [0-255, 0-255, ...], // 128 items\n    ], // 128 items\n    xbit : [\n      [\n        {\n          isSalty : boolean,\n          isWaterCovered : boolean,\n          isWaterProvided : boolean,\n          isPiped : boolean,\n          isPowered : boolean,\n          binaryText: string,\n        }, ...\n      ], // 128 items\n    ], // 128 items\n    surface : [\n      [\n        \"xbld\" | \"xzon\" | \"xter\", ... // 128 items\n      ], // 128 items\n    ],\n  },\n  statistic : {\n    xtrf : 2x2AreaFormat, // Traffic map data\n    xplt : 2x2AreaFormat, // Pollution map data\n    xval : 2x2AreaFormat, // Value map data\n    xcrm : 2x2AreaFormat, // Crime map data\n    xplc : 4x4AreaFormat, // Police coverage map data\n    xfir : 4x4AreaFormat, // Fire coverage map data\n    xpop : 4x4AreaFormat, // Population density map data\n    xrog : 4x4AreaFormat, // Rate of growth map data \n    xgrp : {\n      citySize : GraphFormat,\n      residents : GraphFormat,\n      commerce : GraphFormat,\n      industry : GraphFormat,\n      traffic : GraphFormat,\n      pollution : GraphFormat,\n      value : GraphFormat,\n      crime : GraphFormat,\n      power : GraphFormat,\n      water : GraphFormat,\n      health : GraphFormat,\n      education : GraphFormat,\n      unemployment : GraphFormat,\n      GNP : GraphFormat,\n      nationalPop : GraphFormat,\n      fedRate : GraphFormat,\n    },\n  }\n  city : {\n    cnam : [0-255, 0-255, ...], // 32 items\n    misc : [\n      [0-255, 0-255, ...], // 4 items\n      [],\n    ], // 1200 items\n    xlab : [\n      {\n        length : integer,\n        label: [0-255, 0-255, ...] // 24 items\n      }\n    ],\n    xmic : [\n      {\n        tileNum : 0-255,\n        microsim : [0-255, 0-255, ...] // 6 items\n      }, ... // 150 items\n    ],\n    xthg : [0-255, 0-255, ...], // 480 items\n  },\n  fileSize : integer\n}\n```\n\n### 2x2AreaFormat\n\n```\n[\n  [0-255, 0-255, ...], // 64 items\n], // 64 items\n```\n\n### 4x4AreaFormat\n\n```\n[\n  [0-255, 0-255, ...], // 32 items\n], // 32 items\n```\n\n### GraphFormat\n\n```\n{\n  year : [integer, integer, ...] // 12 items\n  decade : [integer, integer, ...] // 20 items\n  century : [integer, integer, ...] // 20 items\n}\n```\n\n## How to build\n\n1. Clone the repo from github `git clone https://github.com/tom-konda/sc2ktojson.git` \n2. Change current directory `cd sc2ktojson` \n3. Run `npm install`\n4. Run `npm run build`\n\n## License\nLicensed under the MIT\n\n## Acknowledgement\n\n- [SIMCITY 2000 FILE FORMAT (MS-DOS VERSION)](http://djm.cc/simcity-2000-info.txt) for help to understand .sc2 file format. (in English)\n- [シムシティ2000 調査研究室 「その6 シナリオデータの構造」](http://sc2.s27.xrea.com/sc2/research/06.html) for help to understand .scn file format. (in Japanese)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-konda%2Fsc2ktojson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftom-konda%2Fsc2ktojson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-konda%2Fsc2ktojson/lists"}