{"id":13526909,"url":"https://github.com/gopherjs/jsbuiltin","last_synced_at":"2026-01-29T11:47:22.526Z","repository":{"id":57479703,"uuid":"41925770","full_name":"gopherjs/jsbuiltin","owner":"gopherjs","description":"GopherJS bindings for built-in JavaScript functions","archived":false,"fork":false,"pushed_at":"2018-04-26T08:22:42.000Z","size":22,"stargazers_count":35,"open_issues_count":0,"forks_count":7,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-08-13T15:52:28.848Z","etag":null,"topics":["gopherjs-bindings","javascript"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gopherjs.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":"2015-09-04T16:19:59.000Z","updated_at":"2024-05-17T16:43:48.000Z","dependencies_parsed_at":"2022-09-10T01:00:31.186Z","dependency_job_id":null,"html_url":"https://github.com/gopherjs/jsbuiltin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gopherjs/jsbuiltin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopherjs%2Fjsbuiltin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopherjs%2Fjsbuiltin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopherjs%2Fjsbuiltin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopherjs%2Fjsbuiltin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gopherjs","download_url":"https://codeload.github.com/gopherjs/jsbuiltin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopherjs%2Fjsbuiltin/sbom","scorecard":{"id":441302,"data":{"date":"2025-08-11","repo":{"name":"github.com/gopherjs/jsbuiltin","commit":"50091555e127a1aecfeb33cf7101f6a47973b48e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":1,"reason":"Found 3/20 approved changesets -- score normalized to 1","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" 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":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":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 22 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"}}]},"last_synced_at":"2025-08-19T05:38:13.820Z","repository_id":57479703,"created_at":"2025-08-19T05:38:13.820Z","updated_at":"2025-08-19T05:38:13.820Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28876823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T10:31:27.438Z","status":"ssl_error","status_checked_at":"2026-01-29T10:31:01.017Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["gopherjs-bindings","javascript"],"created_at":"2024-08-01T06:01:37.251Z","updated_at":"2026-01-29T11:47:22.497Z","avatar_url":"https://github.com/gopherjs.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"[![Build Status](https://api.travis-ci.org/gopherjs/jsbuiltin.svg?branch=master)](https://travis-ci.org/gopherjs/jsbuiltin) [![GoDoc](https://godoc.org/github.com/gopherjs/jsbuiltin?status.png)](http://godoc.org/github.com/gopherjs/jsbuiltin)\n\njsbuiltin - Built-in JavaScript functions for GopherJS\n------------------------------------------------------\n\nJavaScript has a small number of [built-in\nfunctions](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects)\nto handle some common day-to-day tasks. This package providers wrappers around\nsome of these functions for use in GopherJS.\n\nIt is worth noting that in many cases, using Go's equivalent functionality\n(such as that found in the [net/url](https://golang.org/pkg/net/url/) package)\nmay be preferable to using this package, and will be a necessity any time you\nwish to share functionality between front-end and back-end code.\n\n### What is supported?\nNot all JavaScript built-in functions make sense or are useful in a Go\nenvironment. The table below shows each of the JavaScript built-in functions,\nand its current state in this package.\n\n| Name                 | Supported | Comment                     |\n|----------------------|-----------|-----------------------------|\n| eval()               | --        |                             |\n| uneval()             | --        |                             |\n| isFinite()           | yes       |                             |\n| isNaN()              | yes       |                             |\n| parseFloat()         | TODO?     | See note below              |\n| parseInt()           | TODO?     | See note below              |\n| decodeURI()          | yes       |                             |\n| decodeURIComponent() | yes       |                             |\n| encodeURI()          | yes       |                             |\n| encodeURIComponent() | yes       |                             |\n| escape()             | --        | deprecated circa 2000       |\n| Number()             | --        | See note below              |\n| String()             | --        | Use js.Object.String()      |\n| unescape()           | --        | deprecated circa 2000       |\n| typeof operator      | yes       |                             |\n| instanceof operator  | yes       |                             |\n\n#### Notes on unmplemented functions\n\n* **eval()**: Is there ever a need to eval JS code from within Go?\n* **Number()**: This requires handling a bunch of corner cases which don't\n normally exist in a strictly typed language such as Go. It seems that anyone\n with a legitimate need for this function probably needs to write their own\n wrapper to handle the cases that matter to them.\n* **parseInt()** and **parseFloat()**: These could be added, but doing so\n will require answering some questions about the interfce. JavaScript has\n effectively two relevant data types (int and float) where Go has has 12.\n Deciding how to map JS's `parseInt()` to Go's `(u?)int(8|16|32|64)` types,\n and JS's `parseFloat()` Go's `float(32|64)` or `complex(64|128)` needs to\n be considered, as well as how to handle error cases (Go doesn't have a `NaN`\n type, so any `NaN` result probably needs to be converted to a proper Go\n error). If this matters to you, comments and/or PRs are welcome.\n\n### Installation and Usage\nGet or update this package and dependencies with:\n\n```\ngo get -u -d -tags=js github.com/gopherjs/jsbuiltin\n```\n\n### Basic usage example\n\nThis is a modified version of the Pet example in the main GopherJS documentation,\nto accept and return URI-encoded pet names using the jsbuiltin package.\n\n```go\npackage main\n\nimport (\n\t\"github.com/gopherjs/gopherjs/js\"\n\t\"github.com/gopherjs/jsbuiltin\"\n)\n\nfunc main() {\n\tjs.Global.Set(\"pet\", map[string]interface{}{\n\t\t\"New\": New,\n\t})\n}\n\ntype Pet struct {\n\tname string\n}\n\nfunc New(name string) *js.Object {\n\treturn js.MakeWrapper(\u0026Pet{name})\n}\n\nfunc (p *Pet) Name() string {\n\treturn jsbuiltin.EncodeURIComponent(p.name)\n}\n\nfunc (p *Pet) SetName(uriComponent string) error {\n\tname, err := jsbuiltin.DecodeURIComponent(uriComponent)\n\tif err != nil {\n\t\t// Malformed UTF8 in uriComponent\n\t\treturn err\n\t}\n\tp.name = name\n\treturn nil\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgopherjs%2Fjsbuiltin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgopherjs%2Fjsbuiltin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgopherjs%2Fjsbuiltin/lists"}