{"id":23757084,"url":"https://github.com/mmitch/stitch-compute-npm","last_synced_at":"2026-01-24T06:41:24.079Z","repository":{"id":41994856,"uuid":"332487673","full_name":"mmitch/stitch-compute-npm","owner":"mmitch","description":"compute stitch adjustments for knitting ","archived":false,"fork":false,"pushed_at":"2024-11-18T23:49:48.000Z","size":466,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T23:21:53.871Z","etag":null,"topics":["knit","knitting","stitch"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/stitch-compute","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/mmitch.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":"2021-01-24T15:44:03.000Z","updated_at":"2024-07-08T06:34:42.000Z","dependencies_parsed_at":"2023-02-09T05:47:02.859Z","dependency_job_id":"f6e88efd-f088-4135-b2f2-9f5919d3a426","html_url":"https://github.com/mmitch/stitch-compute-npm","commit_stats":{"total_commits":69,"total_committers":2,"mean_commits":34.5,"dds":0.07246376811594202,"last_synced_commit":"397a4d552043909f8c4b38570627d2b67d58ba57"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/mmitch/stitch-compute-npm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmitch%2Fstitch-compute-npm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmitch%2Fstitch-compute-npm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmitch%2Fstitch-compute-npm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmitch%2Fstitch-compute-npm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmitch","download_url":"https://codeload.github.com/mmitch/stitch-compute-npm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmitch%2Fstitch-compute-npm/sbom","scorecard":{"id":654472,"data":{"date":"2025-08-11","repo":{"name":"github.com/mmitch/stitch-compute-npm","commit":"8c3ac563659ddceb75d29d8ec7e5c03ada935a08"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/6 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":"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":"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":"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/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.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":"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":"Pinned-Dependencies","score":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/mmitch/stitch-compute-npm/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/mmitch/stitch-compute-npm/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/mmitch/stitch-compute-npm/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/mmitch/stitch-compute-npm/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/mmitch/stitch-compute-npm/codeql-analysis.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:30","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   1 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: 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":"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5"],"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-21T14:17:51.265Z","repository_id":41994856,"created_at":"2025-08-21T14:17:51.265Z","updated_at":"2025-08-21T14:17:51.265Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28716868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T05:53:42.649Z","status":"ssl_error","status_checked_at":"2026-01-24T05:53:41.698Z","response_time":89,"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":["knit","knitting","stitch"],"created_at":"2024-12-31T19:36:59.273Z","updated_at":"2026-01-24T06:41:24.062Z","avatar_url":"https://github.com/mmitch.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stitch-compute\n\n[![Code coverage status][codecov-badge]][codecov-url]\n[![CI status][ci-badge]][ci-url]\n\n\u003e Computes evenly distributed additional or combinatory stitches to adjust the length of a knitting row.\n\n## Installation\n\n```bash\n$ npm install stitch-compute\n```\n\n## Usage\n\n```typescript\nimport { StitchCompute } from 'stitch-compute';\n```\n\n### StitchCompute\n\nMain class containing all public functions.\n\n#### adjustEvenly( from, to )\n\nComputes evenly distributed keeps (`K`), additions (`A`) and\ncombinations (`C`) to grow or shrink your knitting row\nfrom `from` stitches to `to` stitches.\n\n```typescript\nconst result = new StitchCompute().adjustEvenly(10, 11);\n// returns \"K5 A1 K5\"\n// meaning: keep 5 stitches, add 1 extra stitch, keep 5 stitches\n\nconst result = new StitchCompute().adjustEvenly(30, 25);\n// returns \"5x ( K2 C1 K2 )\"\n// meaning: keep 2 stitches, combine 2 stitches into 1, keep 2 stitches.\n//          repeat all of this 5 times\n```\n\nNotes:\n\n- `to` must be at least half of `from` and at most twice `from`\n\n#### setFormatters( formatters )\n\nChanges the output texts. `%d` will be replaced by a number, `%s` by a string. To the defaults can be set like this:\n\n```typescript\nimport { StichCompute, FormatterSet } from 'stitch-compute';\nconst stitchComputer = new StitchCompute();\nconst formatters: FormatterSet = {\n  keepStitches: 'K%d',\n  addStitches: 'A%d',\n  combineStitches: 'C%d',\n  groupInstructions: '%dx ( %s )',\n  listSeparator: ' '\n};\nstitchComputer.setFormatters(formatters);\n// stitchComputer.adjustEvenly() will now use the new formatters\n```\n\nNotes:\n\n- errors are thrown if the format strings don't include the required placeholders (see the defaults for what is required where)\n\n## Tests\n\n### Preparation\n\nTo run the tests or calculate the code coverage, all development dependencies have to be installed.\nThis can be done with:\n\n```bash\n$ npm install\n```\n\n### BDD tests\n\nThe BDD tests use the [Mocha](http://mochajs.org) test framework with [Chai](http://chaijs.com) assertions (expect/BDD style).\nThe tests can be run with:\n\n```bash\n$ npm test\n```\n\nResults will directly be shown in the console.\n\n### Code Coverage\n\nCode Coverage is calculated using the /nyc/ commandline frontend to the [Istanbul](https://istanbul.js.org/) project.\nThe code coverage can be calculated with:\n\n```bash\n$ npm run coverage\n```\n\nThe code coverage report will be generated in the `coverage/` subdirectory. Browse `coverage/index.html` to see the report.\n\n## License\n\n[GNU GPL v3 or later](https://www.gnu.org/licenses/#GPL)\n\n## Copyright\n\nCopyright (C) 2021 Christian Garbs \u003cmitch@cgarbs.de\u003e  \nLicensed under GNU GPL v3 or later.\n\nstitch-compute is free software: you can redistribute it and/or modify  \nit under the terms of the GNU General Public License as published by  \nthe Free Software Foundation, either version 3 of the License, or  \n(at your option) any later version.\n\nstitch-compute is distributed in the hope that it will be useful,  \nbut WITHOUT ANY WARRANTY; without even the implied warranty of  \nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  \nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License  \nalong with stitch-compute. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n[codecov-badge]: https://codecov.io/gh/mmitch/stitch-compute-npm/branch/master/graph/badge.svg?token=qE6TI2Ehpx\n[codecov-url]: https://codecov.io/github/mmitch/stitch-compute-npm?branch=master\n[ci-badge]: https://github.com/mmitch/stitch-compute-npm/workflows/Node.js%20CI/badge.svg?branch=master\n[ci-url]: https://github.com/mmitch/stitch-compute-npm/actions?query=workflow%3A%22Node.js+CI%22\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmitch%2Fstitch-compute-npm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmitch%2Fstitch-compute-npm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmitch%2Fstitch-compute-npm/lists"}