Skip to content

iMDT/url-tail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

url-tail

This package allows you to monitor changes to a remote file using polling of an external URL.

This polling uses HTTP range, so only new data is transferred.

Usage

npm install @imdt-os/url-tail

Sample code

const urlTail = require('@imdt-os/url-tail');
const destroy = urlTail("http://127.0.0.1/log.txt", ()=>{
    console.error("Error");
}, (newData, reset)=>{
    if(reset){
        console.log("Discard old data - file was truncated");
    }
    console.log("New data available", newData);
}, {debug: false});

setTimeout( destroy, 60000 ); // Destroy it after 60s

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published