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

@airemad/node-acustic

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

@airemad/node-acustic - npm Package Compare versions

Comparing version 0.1.1 to 1.0.0

__mocks__/node-fetch.js

28

CHANGELOG.md

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

## [1.0.0](https://github.com/airemad/node-acustic/compare/v0.1.1...v1.0.0) (2022-04-30)
### Features
* add json schema for report output ([f87a828](https://github.com/airemad/node-acustic/commits/f87a82812f8ae2901c6689aa63cc9e8cecfcbd73))
* add test fixtures ([519e63b](https://github.com/airemad/node-acustic/commits/519e63b95bc81211411a502771d2d89b1b27ae83))
* added constants ([c966379](https://github.com/airemad/node-acustic/commits/c966379eae289115e8c8691bb75ff07b9c2d8f31))
* added core library ([62e71ac](https://github.com/airemad/node-acustic/commits/62e71ac7a5c236dbd7864ba63b83dae7786063b1))
* added core library tests ([f9307e1](https://github.com/airemad/node-acustic/commits/f9307e15a40b7ae144c70cbb7ac3a2d8e290b77a))
* added download utils ([3a7d686](https://github.com/airemad/node-acustic/commits/3a7d68671f044e4348fea29a91df4aa726dfa7d8))
* added helpers for http requests ([8d4d85f](https://github.com/airemad/node-acustic/commits/8d4d85f11740ff30aff247365e5b650106fdfb51))
* added mock for node-fetch ([5168257](https://github.com/airemad/node-acustic/commits/51682575cbb003091df5d88e661eb054b2d4a419))
* added parser utils ([ed802de](https://github.com/airemad/node-acustic/commits/ed802deaeedeb97d0b4add09b7925eee392ffb37))
* added test definition ([870cfbc](https://github.com/airemad/node-acustic/commits/870cfbcd855988b3012b04ee8d44aea57c32377e))
* added tests for download utils ([1dcae54](https://github.com/airemad/node-acustic/commits/1dcae54b3019bd330835efdb5afbf7c73e6ce8f5))
* added tests for parser ([e077c68](https://github.com/airemad/node-acustic/commits/e077c68e453bc094aa9437788218f3f3d5bd0973))
* added tests for validation ([4fcc35a](https://github.com/airemad/node-acustic/commits/4fcc35a23114f2af525eaa0fb8f42385614d5dff))
* added validation utils ([6adf535](https://github.com/airemad/node-acustic/commits/6adf535a63b8578a94ea5272e8976ad721218b55))
* fixtures alignment ([54cc7b0](https://github.com/airemad/node-acustic/commits/54cc7b05ad3cdc5703dfba7a4fae95fa4a832393))
### Other
* added dependencies ([e88c45c](https://github.com/airemad/node-acustic/commits/e88c45c9496dbacd9665fa01e85cbb3173e8740f))
* added updated documentation ([e9febc1](https://github.com/airemad/node-acustic/commits/e9febc1284b9e35f81d2df507fe17c4d825f630e))
* extended npm rules ([56c90ce](https://github.com/airemad/node-acustic/commits/56c90ce2952ba026d5f9656c08e53fe8da48f671))
### [0.1.1](https://github.com/airemad/node-acustic/compare/v0.1.0...v0.1.1) (2022-04-29)

@@ -7,0 +35,0 @@

9

package.json
{
"name": "@airemad/node-acustic",
"version": "0.1.1",
"version": "1.0.0",
"description": "Node.js Libary to collect, analyze and digest the Acustic Pollution in Madrid",

@@ -59,3 +59,10 @@ "main": "src/index.js",

"standard-version": "9.3.2"
},
"dependencies": {
"@airemad/stations": "1.1.0",
"ajv": "8.11.0",
"ajv-formats": "2.1.1",
"debug": "4.3.4",
"node-fetch": "2.6.7"
}
}

@@ -1,2 +0,108 @@

# node-acustic
Node.js Libary to collect, analyze and digest the Acustic Pollution in Madrid
<p align="center"><h1 align="center">
@airemad/node-acustic
</h1>
<p align="center">
Node.js Libary to collect, analyze and digest the Acustic Pollution in Madrid
</p>
<p align="center">
<a href="https://www.npmjs.org/package/@airemad/node-acustic"><img src="https://badgen.net/npm/v/@airemad/node-acustic" alt="npm version"/></a>
<a href="https://www.npmjs.org/package/@airemad/node-acustic"><img src="https://badgen.net/npm/license/@airemad/node-acustic" alt="license"/></a>
<a href="https://www.npmjs.org/package/@airemad/node-acustic"><img src="https://badgen.net/npm/dt/@airemad/node-acustic" alt="downloads"/></a>
<a href="https://snyk.io/test/github/airemad/node-acustic"><img src="https://snyk.io/test/github/airemad/node-acustic/badge.svg" alt="Known Vulnerabilities"/></a>
</p>
# About
Node.js Libary to collect, analyze and digest the Acustic Pollution in Madrid
## ❤️ Awesome Features:
- debug is supported 💪
- Out of the box simple Interface. 🔥
- Check report integrity against Json Schemas 🧐
- Includes context info like hash, timestamp, source... 🥷
- Easy to use and great test coverage ✅
## Installation
```bash
npm install @airemad/node-acustic
```
## Usage
```js
const { getLastReport } = require('@airemad/node-acustic')
;(async () => {
const {data, hash, source, timestamp} = await getLastReport()
console.log(hash) // 1369f90ec7205649da9abbbc98f63e35
console.log(source) // https://www.mambiente.madrid.es/opendata/ruido.txt
console.log(timestamp) // 1651271749972
console.log(data)
/*
[
...,
{
id: '86',
uuid: '271a6e0a-9d62-49cd-a772-57c1b492441f',
name: 'Tres Olivos',
period: 'night',
date: '2022-04-21',
laeq: 47,
las01: 58,
las10: 51,
las50: 39,
las90: 36,
las99: 36
}
]
*/
})()
```
## Built With
Development only:
- [Standard](https://www.npmjs.com/package/standard) - Linting propuses
- [Husky](https://www.npmjs.com/package/husky) - Git Hooks
- [Commitlint](https://www.npmjs.com/package/@commitlint/cli) - Linting commit messages
- [Jest](https://www.npmjs.com/package/jest) - Testing
- [Standard](https://www.npmjs.com/package/standard) - Linting
- [Standard-version](https://www.npmjs.com/package/standard-version) - Manage changelog and releases
Production only:
- [@airemad/stations](https://www.npmjs.com/package/@airemad/stations) - Stations information
- [node-fetch](https://www.npmjs.com/package/node-fetch) - HTTP Library to download reports
- [debug](https://www.npmjs.com/package/debug) - Manage debugging info
- [ajv](https://www.npmjs.com/package/ajv) - Json Schemas
- [ajv-formats](https://www.npmjs.com/package/ajv-formats) - Extend Json Schemas
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
## Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/airemad/node-acustic/tags).
## Authors
- **Ulises Gascón** - Initial work- - [@ulisesGascon](https://github.com/ulisesGascon)
See also the list of [contributors](https://github.com/airemad/node-acustic/contributors) who participated in this project.
## License
This project is licensed under the GNU AGPL3.0 License - see the [LICENSE.md](LICENSE.md) file for details
## Data sources
We use [Madrid Datos Abiertos](https://datos.madrid.es/portal/site/egob):
- [Dataset: Contaminación acústica. Datos diarios](https://datos.madrid.es/sites/v/index.jsp?vgnextoid=b8c427a272e4e410VgnVCM2000000c205a0aRCRD&vgnextchannel=374512b9ace9f310VgnVCM100000171f5a0aRCRD)

@@ -1,1 +0,21 @@

console.log('Hello from Airemad/node-acustic!')
const debug = require('debug')('airemad-acustic')
const { downloadLastReport, parseReport, checkReportFormat } = require('./utils')
const getLastReport = async () => {
debug('Requesting the last report available has started')
const { content: rawReport, hash, source, timestamp } = await downloadLastReport()
const report = await parseReport(rawReport)
checkReportFormat(report)
debug('Requesting the last report available has finished')
return {
data: report,
hash,
source,
timestamp
}
}
module.exports = {
getLastReport
}
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