1.0.2 • Published 8 years ago

get-content v1.0.2

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

get-content NPM version Build Status Dependency Status Coverage percentage

Fetch content of a url, a file, or even UNIX sockets.;

Install

$ npm install --save get-content

Usage

const { linkType, get } = require("get-content");
const url = 'http://andral.kiwi';
const type = linkType(url);

console.log(type); // 'url'

get(url).then((pageContent) => {
  console.log(pageContent); // <html>\n\t<head>\n...'
}).catch((err) => {
  console.warn(err); // Something happen !
});

get('./README.md').then(function(response){
  console.log(response); /* content of README.md file */
});

License

MIT © Andre Aubin