1.0.2 • Published 3 years ago

link-grabber v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

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));
1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago