oust
Extract URLs to stylesheets, scripts, links, images or HTML imports from HTML
Install
$ npm install --save-dev oust
Usage
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');
API
Options
Attribute | Default | Description |
---|
src | `` | a valid HTML string to parse for references |
type | `` | one of stylesheets , scripts , imports , links , images |
CLI
$ npm install --global oust
Extract URLs to stylesheets, scripts, links, images or HTML imports from HTML
Usage:
$ oust <filename> <type>
$ oust myFile.html stylesheets
$ oust myFile.html scripts
$ oust myFile.html imports
$ oust myFile.html links
$ oust myFile.html images
License
Released under an Apache 2 license. © Google 2014.