{"id":18896129,"url":"https://github.com/udivankin/sunrise-sunset","last_synced_at":"2025-10-12T05:12:01.287Z","repository":{"id":34069803,"uuid":"141721237","full_name":"udivankin/sunrise-sunset","owner":"udivankin","description":"Sunrise and sunset time calculation for given coordinates. ~1kb minified with zero dependencies.","archived":false,"fork":false,"pushed_at":"2023-03-04T02:45:27.000Z","size":1637,"stargazers_count":82,"open_issues_count":10,"forks_count":16,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-31T21:51:34.290Z","etag":null,"topics":["calculations","golden-hour","solar","suncalc","sunrise","sunrise-sunset","sunset"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/udivankin.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-07-20T14:21:59.000Z","updated_at":"2025-04-08T08:34:09.000Z","dependencies_parsed_at":"2023-12-14T08:46:43.152Z","dependency_job_id":null,"html_url":"https://github.com/udivankin/sunrise-sunset","commit_stats":{"total_commits":38,"total_committers":7,"mean_commits":5.428571428571429,"dds":0.5263157894736843,"last_synced_commit":"1997db19876ee7d84749af5554add5af7404c133"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/udivankin/sunrise-sunset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udivankin%2Fsunrise-sunset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udivankin%2Fsunrise-sunset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udivankin%2Fsunrise-sunset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udivankin%2Fsunrise-sunset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/udivankin","download_url":"https://codeload.github.com/udivankin/sunrise-sunset/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udivankin%2Fsunrise-sunset/sbom","scorecard":{"id":906969,"data":{"date":"2025-08-11","repo":{"name":"github.com/udivankin/sunrise-sunset","commit":"1997db19876ee7d84749af5554add5af7404c133"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"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":"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":"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":"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":3,"reason":"Found 3/10 approved changesets -- score normalized to 3","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":"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":"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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 23 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":0,"reason":"33 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"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-24T17:41:47.255Z","repository_id":34069803,"created_at":"2025-08-24T17:41:47.255Z","updated_at":"2025-08-24T17:41:47.255Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010342,"owners_count":26084738,"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-12T02:00:06.719Z","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":["calculations","golden-hour","solar","suncalc","sunrise","sunrise-sunset","sunset"],"created_at":"2024-11-08T08:32:38.278Z","updated_at":"2025-10-12T05:12:01.261Z","avatar_url":"https://github.com/udivankin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sunrise-Sunset-Js\n\nCalculate sunrise and sunset times in Javascript.\nBased loosely and indirectly on Kevin Boone's SunTimes Java implementation of the US Naval Observatory's algorithm.\nWorks on both browser (IE11+) and Node.js, ~1kb minified.\n\n[![Build Status](https://travis-ci.org/udivankin/sunrise-sunset.svg?branch=master)](https://travis-ci.org/udivankin/sunrise-sunset)\n[![Coverage Status](https://coveralls.io/repos/github/udivankin/sunrise-sunset/badge.svg?branch=master)](https://coveralls.io/github/udivankin/sunrise-sunset?branch=master)\n\n### Install\nVia npm:\n\n```bash\nnpm install --save sunrise-sunset-js\n```\n\nVia script tag:\n```html\n\u003cscript src=\"sunrise-sunset.js\"\u003e\n```\n\n### Usage\n\n```javascript\nimport { getSunrise, getSunset } from 'sunrise-sunset-js';\n// Or if you use CommonJS imports:\n// const { getSunrise, getSunset } = require('sunrise-sunset-js')\n\n/** \n * Sunset tonight at the Triggertrap office for today\n */\nconst sunset = getSunset(51.4541, -2.5920);\n\n\n/** \n * Sunrise at Stonehenge on midsummer's day 2000\n */\nconst sunrise = getSunrise(51.1788, -1.8262, new Date(\"2000-06-21\"));\n\n/** \n * Combined with geolocation. Sunset tonight at your location.\n */\nnavigator.geolocation.getCurrentPosition(function(position) {\n  console.log(getSunset(position.coords.latitude, position.coords.longitude));\n});\n\n/** \n * Get all solar events for given year (sorted by time of occurrence)\n */\nfunction getSolarEventsForYear(latitude, longitude, year) {\n  const result = [];\n  const start = new Date(year, 0, 1).getTime();\n  for (let i = 0; i \u003c 366; i++) {\n    const d = new Date(start + (i * 24 * 60 * 60 * 1000));\n    if (d.getFullYear() \u003e year) break; // For non-leap year\n    result.push(['sunrise', getSunrise(latitude, longitude, d)]);\n    result.push(['sunset', getSunset(latitude, longitude, d)]);\n  }\n  return result.filter(event =\u003e Boolean(event[1])).sort((a, b) =\u003e a - b);\n}\ngetSolarEventsForYear(51.1788, -1.8262, 2019);\n```\n\nFor those who still don't use js bundlers, there's global SunriseSunsetJS object,\nwhich exposes the same getSunset and getSunrise methods (must include dist/index.js in your html first)\n\n```javascript\nvar sunset = SunriseSunsetJS.getSunset(51.4541, -2.5920);\nvar sunrise = SunriseSunsetJS.getSunrise(51.4541, -2.5920, new Date(\"2000-06-21\"));\n```\n\nBy Matt Kane (@ascorbic). Copyright © 2012 Triggertrap Ltd. All Rights Reserved.\n\nThis library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General\nPublic License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)\nany later version.\nThis library is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied\nwarranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more\ndetails.\nYou should have received a copy of the GNU Lesser General Public License along with this library; if not, write to\nthe Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA,\nor connect to: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudivankin%2Fsunrise-sunset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fudivankin%2Fsunrise-sunset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudivankin%2Fsunrise-sunset/lists"}