requestdetector

1.0.2 • Public • Published

requestdetector

Simple http/https detector(get response headers)

NPM version License npm node

npm install requestdetector
const detect = require('requestdetector');

Example:1 (async/await)

(async () => {
    try{
        let info = await detect({
            url: 'https://www.78pan.com/api/stats/hls/2018/05/22/aDeuR3Zp/out005.ts',
            timeout:20000
        });
        console.log(info);
    }catch(e){
        console.log(e);
    }
})();

Example:2 (chain called)

detect({
    url: 'https://www.78pan.com/api/stats/hls/2018/05/22/aDeuR3Zp/out005.ts',
    timeout:20000
}).then( (info) => {
    console.log( info );
} ).catch( e => console.log );

Readme

Keywords

Package Sidebar

Install

npm i requestdetector

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

16 kB

Total Files

4

Last publish

Collaborators

  • cxm