1.0.2 • Published 2 years ago

compare-api v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

A simple tool to listen for changes to the endpoint API!

Install

yarn add compare-api 
//or
npm i compare-api

Usage

const CompareAPI = require('compare-api');
const APIListener = new CompareAPI({
    apiUrl: 'https://assistantscenter.com/api/test/',
    timeout: 10000,
    successStatus: 200,
    onCheck: () => console.log('Checking!'),
});

APIListener.start();

APIListener.events.on('dataChanged', ({oldData, newData}) =>{
    console.log(oldData, newData);
});

APIListener.events.on('fetchError', ({message, code}) =>{
    console.log(message, code);
});

Screenshot from usage sample

npm.io

License

The project is under MIT licence.

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago