
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@orzelius/weathermodule
Advanced tools
npm i @orzelius/weathermodule
const { weatherApp } = require('@orzelius/weathermodule');
//Uncached verson
weatherApp.getData('York', 1)
.then(data => console.log(data))
.catch(err => {
throw err;
});
First parameter is the name of the city and the second one is optional index, if more than one city is returned.
const { weatherApp, DataCash } = require('@orzelius/weathermodule');
//Declare cache
const cachedWeatherApp = new DataCash(() => { return weatherApp.getData('York', 1) }, 0.05)
//Use cache
console.log(cachedWeatherApp.getData().then((data) => { console.log(!!data) }));
//Some timeouts to see it work
setTimeout(cachedWeatherApp.getData, 1000);
setTimeout(cachedWeatherApp.getData, 2000);
setTimeout(cachedWeatherApp.getData, 3000);
setTimeout(cachedWeatherApp.getData, 4000);
setTimeout(cachedWeatherApp.getData, 5000);
setTimeout(cachedWeatherApp.getData, 6000);
The 0.05 is cache ttl in minutes (3s in this case)
FAQs
Weather API library
We found that @orzelius/weathermodule 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.