Package Exports
- html-link-extractor
- html-link-extractor/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (html-link-extractor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
html-link-extractor
Extracts links from html texts.
Installation
$ npm install --save html-link-extractor
API
htmlLinkExtractor(html)
Parameters:
html
text in html format.
Returns:
- an array of URLs
Examples
const { readFileSync } = require('fs');
const htmlLinkExtractor = require('html-link-extractor');
const html = readFileSync('index.html', {encoding: 'utf8'});
const links = htmlLinkExtractor(html);
links.forEach(link => console.log(link));
Testing
npm test
License
See LICENSE.md