Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
dark-sky-api
Advanced tools
A simple and robust wrapper library for Dark Sky API (previously known as Forecast.io).
Features:
See Dark Sky developer docs: https://darksky.net/dev/docs.
Need something even smaller? Dark sky api uses dark-sky-skeleton.
npm install dark-sky-api
import DarkSkyApi from 'dark-sky-api';
Configuring dark-sky-api with an api key is supported but each request will expose said api key (for anyone to capture).
For this reason Dark Sky strongly suggests hiding your API key through use of a proxy [ref].
// one of the two is required
DarkSkyApi.apiKey = 'your-dark-sky-api-key';
DarkSkyApi.proxyUrl = '//base-url-to-proxy/service';
// optional configuration
DarkSkyApi.units = 'si'; // default 'us'
DarkSKyApi.language = 'de'; // default 'en'
Today's weather:
DarkSkyApi.getCurrent()
.then(result => console.log(result));
Forecasted week of weather:
DarkSkyApi.getForecast()
.then(result => console.log(result));
By default dark-sky-api will use Geolocation.getCurrentPosition to grab the current browser location automatically.
To manually set geolocation position pass along a position object:
const position = {
latitude: 43.075284,
longitude: -89.384318
};
DarkSkyApi.getCurrent(position)
.then(result => console.log(result));
To get the units used in dark sky api responses per configured unit type (default is 'us') use GetResponseUnits after configuration.
const units = DarkSkyApi.getResponseUnits();
FAQs
a simple and robust dark sky api service for client-side js
The npm package dark-sky-api receives a total of 69 weekly downloads. As such, dark-sky-api popularity was classified as not popular.
We found that dark-sky-api 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.