Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Calculate sunrise and sunset times for a given date and location.
# npm
npm install --save sunriset
# yarn
yarn add sunriset
Also support CDN:
<script src="https://www.jsdelivr.com/package/npm/sunriset"></script>
Support UMD
packaging specification:
import sunriset from 'sunriset';
// OR
const sunriset = require('sunriset');
Example:
import sunriset from 'sunriset';
// Sunrise and sunset times of Beijing, December 27, 2019.
const longitude = 116.404;
const latitude = 39.908;
const getSuntime = sunriset(new Date(), latitude, longitude);
// {
// sunrise: {
// raw_time: [7, 35],
// angle: 120.28914956738069,
// time: '07:35',
// formatted: '7:35, az = 120.28914956738069°',
// },
// sunset: {
// raw_time: [16, 56],
// angle: 239.73664214319098,
// time: '16:56',
// formatted: '16:56, az = 239.73664214319098°',
// },
// date: '2019-12-27T01:25:08.897Z',
// coordinates: [39.908, 0.32334444444444443],
// }
sunriset(date, lat, lon)
Calculate sunrise and sunset times for a given date and location.
date
: The date you want to find the sun data for.lat
: The latitude.lon
: The longitude.sunrise
(Object):
raw_time
(Array): An array of two numbers (hours and minutes)time
(String): Formatted sunrise time (HH:mm
)sunset
(Object):
raw_time
(Array): An array of two numbers (hours and minutes)time
(String): Formatted sunset time (HH:mm
)date
(Date): The provided date.coordinates
(Array): An array of latitude and longitude values.FAQs
Calculate sunrise and sunset times
We found that sunriset demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.