1.1.0 • Published 10 months ago

@marketto/belfiore-connector-json v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

belfiore-connector-json

Belfiore datasource connector: embedded dataset Best for embedded FE usage

NPM Version NPM Downloads LICENSE Blog Buy me a coffee

🖋️ 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

  • NodeJs
  • Chrome
  • Firefox
  • 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

📝 AUTHOR

Marco Ricupero

1.1.0

10 months ago

1.0.0

11 months ago