npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vant-api

v0.5.1

Published

RESTful API for storing and retrieving vantage weather data.

Downloads

227

Readme

vant-api

RESTful API for storing and retrieving vantage weather data.

Introduction

There are two main components.

  1. RESTful API - process and provide weather data
  2. recorder - upload weather data

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!

Usage

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!

Documentation

First of all you should read the guides. After that you may get more information and read the official documentation.

Roadmap

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.

Planned endpoints

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.