https://github.com/marketto/belfiore-connector-json
https://github.com/marketto/belfiore-connector-json
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/marketto/belfiore-connector-json
- Owner: Marketto
- License: mit
- Created: 2024-08-13T07:55:02.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-09-21T02:17:00.000Z (9 months ago)
- Last Synced: 2024-09-21T12:18:43.644Z (9 months ago)
- Language: TypeScript
- Size: 257 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.MD
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# belfiore-connector-json
**Belfiore datasource connector: embedded dataset**
Best for embedded FE usage[](https://www.npmjs.com/package/@marketto/belfiore-connector-json)
[](https://www.npmjs.com/package/@marketto/belfiore-connector-json)
[](https://github.com/Marketto/belfiore-connector-json/blob/master/LICENSE)
[](http://blog.marketto.it)
[](https://ko-fi.com/marketto)## 🖋️ WRITE YOUR OWN CONNECTOR
Not the **BelfioreConnector** you are looking for?
[**@marketto/belfiore-connector**](https://www.npmjs.com/package/@marketto/belfiore-connector): Abstract class & interfaces to write your own connector
## 🔌 INSTALLATION
### NPM
```{r, engine='bash', global_install}
npm i -s @marketto/belfiore-connector-json
```### Script
```html
```
## 🔧 USAGE
### CJS
```javascript
const BelfioreConnector = require("@marketto/belfiore-connector-json");
```### MJS & TypeScript
```javascript
import BelfioreConnector from "@marketto/belfiore-connector-json";
```## INITIALIZATION
### Static List
```javascript
const belfioreConnector = new BelfioreConnector(myPlaceList);
```### Async function to retrieve data
```javascript
// Passing a function to download place list and options to set the life time to 10 minutes
// When needed the function will be called and results cached for the set life time
// null / undefined = forever, 0 expire after every single usage
const belfioreConnector = new BelfioreConnector(
() => fetch(url).then((response) => response.json()),
{ lifeTimeSec: 600 }
);
```## 📖 [DOCUMENTATION](https://marketto.github.io/belfiore-connector-json/)
## 📙 [CHANGELOG](CHANGELOG.MD)
## 🔃 Compatibility
- [x] NodeJs
- [x] Chrome
- [x] Firefox
- [x] Edge## ✋ DISCLAMER
All names, informations, and fiscal codes used in this README and all unit tests are fictitious.
No identification with actual persons (living or deceased) is intended or should be inferred## 📜 [LICENSE: MIT](LICENSE)
## 📚 ASSETS LICENSES AND AUTHORS
- Cities List of Values: [CC BY 4.0](asset/MINISTERO_DELL_INTERNO.LICENSE) Ministero dell'interno
- Cities List of Values: [CC BY 4.0](asset/AGENZIA_DELLE_ENTRATE.LICENSE) Agenzia delle Entrate
- Countries List of Values: [CC BY 3.0](asset/ISTITUTO_NAZIONALE_DI_STATISTICA.LICENSE) Istituto nazionale di statistica## 📝 AUTHOR
[Marco Ricupero](mailto:[email protected])