Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
vant-api
Advanced tools
Readme
RESTful API for storing and retrieving vantage weather data.
There are two main components.
The api is an expressjs api, which manages a database and provides simple endpoints to access your weather data.
The recorder repeatedly uploads weather data to the api.
Both of them together form a robust platform!
Running the vantage api is super easy!
import { api } from "vant-api/api";
async function main(){
api.configure({
units: {
temperature: "°C",
},
port: 5231,
});
await api.start();
}
main();
Running the recorder is also pretty easy.
import { Recorder } from "vant-api/recorder";
async function main(){
// Configure recorder
const recorder = await Recorder.create({
path: "COM5",
api: "http://localhost:8000/api",
key: "your-api-key",
...
});
// Configure "/api/v1/current" update interval
recorder.configureCurrentConditionsTask({
interval: 1,
});
// Start recorder
recorder.start();
}
main();
Read the guides to get started!
First of all you should read the guides. After that you may get more information and read the official documentation.
This project is in an early stage. There is still so much to come. Currently the api only stores the current weather conditions. This will change.
Currently following endpoints are planned. This may change.
/highs-and-lows/:interval
This route will return interesting records. Using the
:interval
you will be able to choose different periods.
Possible values will be: hour
, day
, week
, month
, year
. By default it will assume that you are interested in the current hour, day, etc. This is changeable by passing a time
query parameter. E.g. /highs-and-lows/week?time=2023/34
(this requests the highs and lows of the 34 calendar week of 2023).
{
"success": true,
"interval": "year",
"data": {
"tempOut": {
"low": {
"value": -12.4,
"time": "2004-01-28"
},
"high": {
"value": 39.2,
"time": "2004-08-27"
}
},
...
}
}
/summary/:interval
This route will return a summary of the passed interval.
Possible values will be: hour
, day
, week
, month
, year
.
{
"success": true,
"interval": "day",
"data": {
"rain": 7.4,
"windDir": "W",
"tempOut": {
"low": {
"value": 9.4,
"time": "05:34"
},
"high": {
"value": 14.9,
"time": "14:22"
}
},
...
}
}
This route will be useful for generating graphs that visualize the weather of a specified interval.
FAQs
RESTful API for storing and retrieving vantage weather data.
The npm package vant-api receives a total of 1 weekly downloads. As such, vant-api popularity was classified as not popular.
We found that vant-api demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.