1.0.2 • Published 3 years ago
link-grabber v1.0.2
Link Grabber
A simple Node.js tool for grabbing links from the webpages.
Overview
This tool grabs <a>
links from the page and return the array of objects that looks like this:
[
{
source: '<a href="/chat">Live Chat</a>',
href: '/chat',
content: 'Live Chat',
isExternal: false
}
]
It exports function that is called getLinks()
which takes one parameter (URL)
. Refer to the Usage section for examples.
Installation
$ npm install link-grabber --save
Usage
const linkGrabber = require('link-grabber');
linkGrabber.getLinks("https://github.com/")
.then(links => console.log(links))
.catch(err => console.error(err));