find-resources
Scans HTML and CSS for static resource URLs.
npm install find-resources
var findResources = ; var urls = findResources; console;// > ['foo.jpg', 'bar.css']
- You can also do
findResources.css(cssString)
to find resource URLs in CSS (background images, fonts – anything in aurl(...)
). - The
findResources.html()
function also uses the.css()
function under the hood to search inside inline<style>
elements. - Both functions accept a second argument of options.
Options
Pass an object with any of these properties, shown here with their default values, to choose what kinds of URLs should be included in the results:
domainRelative
(true)fileRelative
(true)data
(false)external
(false)
License
Copyright (c) 2014 . Licensed under the MIT license.