{"id":17472670,"url":"https://github.com/shinnn/toggle-gist-star","last_synced_at":"2025-10-16T08:39:33.113Z","repository":{"id":57377649,"uuid":"49568781","full_name":"shinnn/toggle-gist-star","owner":"shinnn","description":"Unstar the gist if you've already starred it, otherwise star it","archived":false,"fork":false,"pushed_at":"2016-09-05T10:46:37.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-01T13:55:35.615Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/shinnn.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":"2016-01-13T11:08:21.000Z","updated_at":"2016-01-13T11:20:43.000Z","dependencies_parsed_at":"2022-09-19T02:43:41.587Z","dependency_job_id":null,"html_url":"https://github.com/shinnn/toggle-gist-star","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/shinnn/toggle-gist-star","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Ftoggle-gist-star","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Ftoggle-gist-star/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Ftoggle-gist-star/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Ftoggle-gist-star/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shinnn","download_url":"https://codeload.github.com/shinnn/toggle-gist-star/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Ftoggle-gist-star/sbom","scorecard":{"id":819188,"data":{"date":"2025-08-18","repo":{"name":"github.com/shinnn/toggle-gist-star","commit":"6a13c863633027def26c0adf565d10fe0e0352f4"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":3,"checks":[{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/5 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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T14:57:12.405Z","repository_id":57377649,"created_at":"2025-08-23T14:57:12.405Z","updated_at":"2025-08-23T14:57:12.405Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279170491,"owners_count":26118598,"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-16T02:00:06.019Z","response_time":53,"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":[],"created_at":"2024-10-18T17:32:02.785Z","updated_at":"2025-10-16T08:39:33.066Z","avatar_url":"https://github.com/shinnn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# toggle-gist-star\n\n[![NPM version](https://img.shields.io/npm/v/toggle-gist-star.svg)](https://www.npmjs.com/package/toggle-gist-star)\n[![Build Status](https://travis-ci.org/shinnn/toggle-gist-star.svg?branch=master)](https://travis-ci.org/shinnn/toggle-gist-star)\n[![Coverage Status](https://img.shields.io/coveralls/shinnn/toggle-gist-star.svg)](https://coveralls.io/github/shinnn/toggle-gist-star)\n[![Dependency Status](https://david-dm.org/shinnn/toggle-gist-star.svg)](https://david-dm.org/shinnn/toggle-gist-star)\n[![devDependency Status](https://david-dm.org/shinnn/toggle-gist-star/dev-status.svg)](https://david-dm.org/shinnn/toggle-gist-star#info=devDependencies)\n\nUnstar the [gist](https://gist.github.com/) if you've already starred it, otherwise star it\n\n```javascript\nconst toggleGistStar = require('toggle-gist-star');\n\nconst token = 'xxx'; // your Github API access token\nconst gistId = '908bced575270f6ef80e';\n\ntoggleGistStar(gistId, {token})\n.then(() =\u003e {\n  console.log('Starred https://gist.github.com/908bced575270f6ef80e');\n  return toggleGistStar(gistId, {token});\n})\n.then(() =\u003e {\n  console.log('Unstarred https://gist.github.com/908bced575270f6ef80e');\n});\n```\n\n## Installation\n\n[Use npm.](https://docs.npmjs.com/cli/install)\n\n```\nnpm install toggle-gist-star\n```\n\n## API\n\n```javascript\nconst toggleGistStar = require('toggle-gist-star');\n```\n\n### toggleGistStar(*gistId* [, *options*])\n\n*gistId*: `String` (a gist ID, for example \u003chttps://gist.github.com/tim/34309\u003e → `'34309'`)  \n*options*: `Object` ([`gh-get` options](https://github.com/shinnn/gh-get#options))  \nReturn: [`Promise`](http://www.ecma-international.org/ecma-262/6.0/#sec-promise-constructor) instance\n\nIt [checks if a gist with the given ID is starred or not](https://github.com/shinnn/is-gist-starred), then [unstars it](https://github.com/shinnn/unstar-gist) if it's already starred by the authenticated user, otherwise [stars it](https://github.com/shinnn/star-gist).\n\nThe promise will be [*fulfilled*](https://promisesaplus.com/#point-26) with an [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_http_incomingmessage) object if successful, otherwise [*rejected*](https://promisesaplus.com/#point-30) with an error.\n\n```javascript\ntoggleGistStar('ab12852099', {token: 'xxxxxx'}).catch(err =\u003e {\n  err.message;\n  //=\u003e '404 Not Found (Gist not found: https://gist.github.com/ab12852099)'\n});\n\ntoggleGistStar('2790533', {token: 'invalid_token'}).catch(err =\u003e {\n  err.message;\n  //=\u003e '401 Unauthorized (Bad credentials)'\n});\n```\n\n## License\n\nCopyright (c) 2016 [Shinnosuke Watanabe](https://github.com/shinnn)\n\nLicensed under [the MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Ftoggle-gist-star","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshinnn%2Ftoggle-gist-star","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Ftoggle-gist-star/lists"}