shark-netlib

Shark netlib - a Simple Get Function as a Promise

Usage no npm install needed!

<script type="module">
  import sharkNetlib from 'https://cdn.skypack.dev/shark-netlib';
</script>

README

Shark netlib

Install: npm i shark-netlib

Example:


const shnet=require("shark-netlib");
shnet("https://example.com", true).then((data)=>{console.log(data.body);console.log(`SRC (IF REDIRECTION, CONTAIN URL WHERE THIS PROGRAMM GET data.body): ${data.redirectedto})`)}, (err)=>{console.error("an error occured");});//DETECT IF IT IS http or https and use the correct function

(SECOND ARG: FOLLOW REDIRECTS (bool))