Extract URLs to stylesheets, scripts, links, images or HTML imports from HTML
npm install oust --save-dev
First include:
var oust = require('oust');
Resource links can then be extracted from either files:
var hrefs = oust(htmlString, 'stylesheets');
var srcs = oust(htmlString, 'scripts');
var hrefs = oust(htmlString, 'imports');
var srcs = oust(htmlString, 'links');
var srcs = oust(htmlString, 'images');
Attribute | Default | Description |
---|---|---|
src |
`` | a valid HTML string to parse for references |
type |
`` | one of stylesheets , scripts , imports , links , images |
Released under an Apache 2 license. © Google 2014.