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

@airemad/stations

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@airemad/stations - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

## [1.1.0](https://github.com/airemad/stations/compare/v1.0.0...v1.1.0) (2022-04-29)
### Features
* added feature getStationById ([fccc586](https://github.com/airemad/stations/commits/fccc5864d56d69c7b47c86a93c7bc6863803959f))
## [1.0.0](https://github.com/airemad/stations/compare/v0.1.4...v1.0.0) (2022-04-29)

@@ -7,0 +14,0 @@

2

package.json
{
"name": "@airemad/stations",
"version": "1.0.0",
"version": "1.1.0",
"description": "List of the measurement stations available in Madrid",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -34,2 +34,4 @@ <p align="center"><h1 align="center">

## Usage
### Get All Stations
```js

@@ -61,2 +63,20 @@ const { getAll } = require('@airemad/stations')

### Get specific station
```js
const { getStationById } = require('@airemad/stations')
const station = getStationById('0086') // 86, '86', '000086' ...
console.log(station)
/*
{
"id": "86",
....
}
*/
const inventedStation = getStationById('999999')
console.log(inventedStation) // null
```
## Built With

@@ -63,0 +83,0 @@

const stations = require('./stations.json')
const getStationById = id => {
const selectedStation = stations.filter(station => {
return id === station.id || parseInt(id) === parseInt(station.id)
})
return selectedStation.length ? selectedStation[0] : null
}
module.exports = {
getAll: () => stations
getAll: () => stations,
getStationById
}
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