{"id":20569641,"url":"https://github.com/mrgriefs/calculate-string","last_synced_at":"2025-10-14T07:40:29.256Z","repository":{"id":37986591,"uuid":"362234209","full_name":"MrGriefs/calculate-string","owner":"MrGriefs","description":"Parses a string containing mathematical operators to a number","archived":false,"fork":false,"pushed_at":"2022-12-06T01:02:58.000Z","size":171,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-22T04:49:09.944Z","etag":null,"topics":["javascript","numbers","parser","string-manipulation"],"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/MrGriefs.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}},"created_at":"2021-04-27T19:53:56.000Z","updated_at":"2021-10-19T01:16:54.000Z","dependencies_parsed_at":"2023-01-23T05:15:18.027Z","dependency_job_id":null,"html_url":"https://github.com/MrGriefs/calculate-string","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/MrGriefs/calculate-string","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrGriefs%2Fcalculate-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrGriefs%2Fcalculate-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrGriefs%2Fcalculate-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrGriefs%2Fcalculate-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrGriefs","download_url":"https://codeload.github.com/MrGriefs/calculate-string/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrGriefs%2Fcalculate-string/sbom","scorecard":{"id":96642,"data":{"date":"2025-08-11","repo":{"name":"github.com/MrGriefs/calculate-string","commit":"49ac400a9147aefdbb95e68f3fba07bb8d25b53d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.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":"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":"Code-Review","score":0,"reason":"Found 0/26 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":"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/npmpublish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/MrGriefs/calculate-string/npmpublish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/MrGriefs/calculate-string/npmpublish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/MrGriefs/calculate-string/npmpublish.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/npmpublish.yml:18","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 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":9,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/npmpublish.yml:9","Warn: no topLevel permission defined: .github/workflows/npmpublish.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":"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":"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":"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 'main'"],"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":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 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":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986"],"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-15T09:11:32.024Z","repository_id":37986591,"created_at":"2025-08-15T09:11:32.024Z","updated_at":"2025-08-15T09:11:32.024Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018215,"owners_count":26086307,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","numbers","parser","string-manipulation"],"created_at":"2024-11-16T05:09:04.863Z","updated_at":"2025-10-14T07:40:29.239Z","avatar_url":"https://github.com/MrGriefs.png","language":"JavaScript","funding_links":["https://patreon.com/yeen"],"categories":[],"sub_categories":[],"readme":"\u003ch2 align=\"center\"\u003eCalculate String\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://patreon.com/yeen\"\u003e\u003cimg alt=\"Patreon\" src=\"https://img.shields.io/badge/patreon-donate?color=F77F6F\u0026labelColor=F96854\u0026logo=patreon\u0026logoColor=ffffff\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/MrGriefs/calculate-string\"\u003e\u003cimg alt=\"David\" src=\"https://img.shields.io/david/MrGriefs/calculate-string\"\u003e\u003c/a\u003e\n\u003ca href=\"https://travis-ci.com/github/MrGriefs/calculate-string\"\u003e\u003cimg alt=\"Travis CI\" src=\"https://api.travis-ci.com/MrGriefs/calculate-string.svg?branch=main\"\u003e\u003c/a\u003e\n\u003cimg alt=\"GitHub package.json version\" src=\"https://img.shields.io/github/package-json/v/MrGriefs/calculate-string\"\u003e\n\u003ca href=\"https://github.com/MrGriefs/calculate-string\"\u003e\u003cimg alt=\"RunKit\" src=\"https://img.shields.io/node/v/calculate-string\"\u003e\u003c/a\u003e\n\u003ca href=\"https://npm.runkit.com/calculate-string\"\u003e\u003cimg alt=\"RunKit\" src=\"https://img.shields.io/badge/Run-Kit-red\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003eParses strings containing mathematical operations.\u003c/p\u003e\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Usage](#usage)\n\n## Introduction\n\n### Why?\n\nSo you can parse a string without using unsafe evals nor have to spend a detour creating a parser.\n\n## Installation\n\nWith npm:  \n\n```bash\n$ npm install calculate-string\n```\n\nWith yarn:  \n\n```bash\n$ yarn add calculate-string\n```\n\n## Usage\n\nTry me on [RunKit](https://npm.runkit.com/calculate-string)\n\n```javascript\nconst calculateString = require('calculate-string')\n\ncalculateString('1,000 + 1,000') // String: '2000'\ncalculateString('(100 + 10) / 10') // String: '11'\nBigInt(calculateString('2 ** 64')) // BigInt: 18,446,744,073,709,551,616\nBigInt(calculateString('NaN')) // SyntaxError: Cannot convert NaN to a BigInt\nNumber(calculateString('1e+6 ^ -1e+6')) // Number: -Infinity\ncalculateString(\"this won't get parsed\")) == 'NaN' // Boolean: true\ncalculateString('1,000,000 ^ 10') // String: '1e+60'\nNumber(calculateString('1,000,000 ^ 10')) // Number: 1e+60\n```\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript src=\"https://unpkg.com/calculate-string/index.min.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cp id=\"result\"\u003e\u003c/p\u003e\n    \u003cscript\u003e\n      document.getElementById(\"result\").innerHTML = calculateString(\n        \"100 + 100\"\n      );\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrgriefs%2Fcalculate-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrgriefs%2Fcalculate-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrgriefs%2Fcalculate-string/lists"}