Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lanuv-parser

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lanuv-parser - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

37

index.js

@@ -20,5 +20,9 @@ 'use strict'

*/
const query = (url) => {
const query = (url, options = {}) => {
return new Promise((resolve, reject) => {
request(url, function (error, response, body) {
request({
url,
method: options.method ? options.method : 'GET',
form: options.form ? options.form : undefined
}, function (error, response, body) {
if (error) {

@@ -41,3 +45,3 @@ reject(error)

*
* @param {*} options
* @param options.allStations return all stations if true
* @returns Promise resolves with an array of all luqs stations

@@ -47,3 +51,28 @@ */

return new Promise((resolve, reject) => {
query(messorteUrl)
let requestOptions
const { status, allStations } = options
if (status) {
requestOptions = {
method: 'POST',
form: {
auswahl_plz: 'alle',
auswahl_status: status,
auswahl_klassifizierung: 'alle'
}
}
}
if (allStations) {
console.info('Option allStations is deprecated and will be removed in a future release!')
requestOptions = {
method: 'POST',
form: {
auswahl_plz: 'alle',
auswahl_status: 'alle',
auswahl_klassifizierung: 'alle'
}
}
}
query(messorteUrl, requestOptions)
.then($ => {

@@ -50,0 +79,0 @@ const stations = []

5

package.json

@@ -1,5 +0,4 @@

{
"name": "lanuv-parser",
"version": "0.2.0",
"version": "0.2.1",
"description": "Parse LANUV website for LUQS (Air Quality) stations",

@@ -13,3 +12,3 @@ "license": "MIT",

"engines": {
"node": ">=10"
"node": ">=14"
},

@@ -16,0 +15,0 @@ "scripts": {

@@ -31,2 +31,7 @@ # lanuv-parser

Optionally accepts an `options` object as first parameter:
- `status: aktiv|inaktiv|alle` returns stations with the specified status
- `allStations: true` returns all active and inactive stations. Overrides the `status` option **Deprecated**
### luqs.station(kuerzel)

@@ -33,0 +38,0 @@ Returns detailed information about a specific LUQS station

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc