
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
rws-waterinfo-api
Advanced tools
Node.js wrapper for the RWS waterinfo api.
Docs about the API can be found here. Docs are in english, but the API itself is mostly Dutch. This wrapper is mostly in English, aside from a couple variable names.
npm install rws-waterinfo-api
Usage
import * as rws from 'rws-waterinfo-api'
rws.getLocations()
.then(locations => console.log(locations))
.catch(err => console.error(err))
// Or import a single function
import { getLocations } from 'rws-waterinfo-api'
getLocations()
.then(locations => console.log(locations))
.catch(err => console.error(err))
getLocations(): Promise<StationLocation[]>
getLocations(rawData: true): Promise<MetadataResponse>
Get all available stations for use in getObservations and getLatestObservations.
Returns StationLocation[]
by default. Pass in true
to get the raw data.
getMetadata(): Promise<MetadataParsed[]>
getMetadata(rawData: true): Promise<MetadataResponse>
Get all available variables for use in getObservations and getLatestObservations.
Returns MetadataParsed[]
by default. Pass in true
to get the raw data.
getObservations(requestData: ObservationRequestData): Promise<Observations>
getObservations(requestData: ObservationRequestData, rawData: true): Promise<ObservationsResponse>
Get RWS observations data for the given variables, at the given station location, within the specified timeframe.
Returns Observations
by default. Pass in true
after the requestData
object to get the raw data.
Object in the following format:
{
variables: {
grootheid?: string;
eenheid?: string;
compartiment?: string;
hoedanigheid?: string;
meetapparaat?: string;
parameter?: string;
};
location: {
coordinates: {
x: number;
y: number
};
code: string;
};
period: {
start: string;
end: string;
};
}
Available variables can be fetched using the getMetadata method. Variables are in Dutch because the data the description they contain are also in Dutch, and I'm not sure how to translate each of them. Feel free to make a PR to correct this.
Main variables you'll likely want to use are grootheid
, which is used to get a single data type (e.g. windspeed with code WINDSHD
), and compartiment
, which is used to get a group of pre-defined data types (e.g. air with code LT
to get all data related to the air (wind speed, direction e.t.c.)).
Available locations can be fetched using the getLocations method.
Period is an object consisting of a start and end date. The strings need to be in ISO format. For example: 2022-04-26T20:30:00.000+01:00
.
getLatestObservations(requestData: LatestObservationRequestData): Promise<Observations[]>
getLatestObservations(requestData: LatestObservationRequestData, rawData: true): Promise<LatestObservationResponse>
Get latest RWS observation data for the given variables at the given station location(s).
Returns Observations[]
by default. Pass in true
after the requestData
object to get the raw data.
This method differs from getObservations in the following ways:
// Both variables and locations can also be an array of objects, if fetching multiple.
{
variables: {
grootheid?: string;
eenheid?: string;
compartiment?: string;
};
locations: {
coordinates: {
x: number;
y: number
};
code: string;
};
}
Available variables can be fetched using the getMetadata method.
Available locations can be fetched using the getLocations method.
FAQs
Nodejs wrapper for the RWS waterinfo api
The npm package rws-waterinfo-api receives a total of 0 weekly downloads. As such, rws-waterinfo-api popularity was classified as not popular.
We found that rws-waterinfo-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.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.