1.1.5 • Published 2 years ago

fetch-periodic-sync v1.1.5

Weekly downloads
9
License
ISC
Repository
github
Last release
2 years ago

fetch-periodic-sync

fetch() a URL periodically, with caching & data-saving support.

npm version ISC-licensed minimum Node.js version support me via GitHub Sponsors chat with me on Twitter

Installation

npm install fetch-periodic-sync

Usage

const syncViaPeriodicFetch = require('fetch-periodic-sync')

const synced = syncViaPeriodicFetch('https://wikipedia.org/', {
	interval: 5_000,
})

synced.on('error', (err) => {
	console.error('failed to refresh Wikipedia', err)
})
synced.on('change', (res) => {
	// res is a Fetch API Response
	// https://developer.mozilla.org/en-US/docs/Web/API/Response
	res.text().then(console.log)
})

Contributing

If you have a question or need support using fetch-periodic-sync, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, use the issues page.

1.1.5

2 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago