@marketto/belfiore-connector-json
v1.1.0
Published
TS & JS Belfiore datasource connector: json dataset
Downloads
19
Readme
belfiore-connector-json
Belfiore datasource connector: embedded dataset Best for embedded FE usage
🖋️ WRITE YOUR OWN CONNECTOR
Not the BelfioreConnector you are looking for?
@marketto/belfiore-connector: Abstract class & interfaces to write your own connector
🔌 INSTALLATION
NPM
npm i -s @marketto/belfiore-connector-json
Script
<script src="https://unpkg.com/@marketto/belfiore-connector-json/dist/belfiore-connector-json.bundle.min.js"></script>
🔧 USAGE
CJS
const BelfioreConnector = require("@marketto/belfiore-connector-json");
MJS & TypeScript
import BelfioreConnector from "@marketto/belfiore-connector-json";
INITIALIZATION
Static List
const belfioreConnector = new BelfioreConnector(myPlaceList);
Async function to retrieve data
// 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
📙 CHANGELOG
🔃 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
📚 ASSETS LICENSES AND AUTHORS
- Cities List of Values: CC BY 4.0 Ministero dell'interno
- Cities List of Values: CC BY 4.0 Agenzia delle Entrate
- Countries List of Values: CC BY 3.0 Istituto nazionale di statistica