Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
dark-sky-skeleton
Advanced tools
barebones dark sky weather api for client side js - supports api key and proxy urls
Based on Elias Hussary's dark-sky.
A barebones wrapper library for Dark Sky API (previously known as Forecast.io). See Dark Sky developer docs: https://darksky.net/dev/docs.
For a more robust solution see dark-sky-api.
npm install dark-sky-skeleton
import darkSkySkeleton from 'dark-sky-skeleton';
While dark-sky-skeleton allows embedding api keys through use of jsonp on the backend using a proxy to make the api call is highly suggested as this hides the API key from client side requests [ref].
const darkSky = new darkSkySkeleton('your-dark-sky-api-key', '//base-url-to-proxy/service');
darkSky.latitude(lat)
.longitude(long)
.units('us')
.language('en')
.time('2000-04-06T12:20:05') // moment().year(2000).format('YYYY-MM-DDTHH:mm:ss')
.extendHourly(true)
.get();
.then(data => console.log(data));
Feel free to omit setting of latitude and longitude for subsequent calls i.e.:
const darkSky = new darkSkyApi('your-dark-sky-api-key');
darkSky.latitude(lat)
.longitude(long);
darkSky.get();
"Exclude some number of data blocks from the API response. This is useful for reducing latency and saving cache space (see 'Request Parameters')."
const excludes = ['alerts', 'currently', 'daily', 'flags', 'hourly', 'minutely'],
exludesBlock = excludes.filter(val => val != 'currently').join(',')
darkSky.latitude(lat)
.longitude(long)
.exclude(excludesBlock)
.get()
.then(data => console.log(data));
FAQs
barebones dark sky weather api - for client or server-side js
We found that dark-sky-skeleton 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.
Security News
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.