Get all URLs inside stylesheets
$ npm install css-urls --save
const got = require('got')
const cssUrls = require('css-urls')
;(async () => {
const url = process.argv[2]
if (!url) throw new TypeError('Need to provide an url as first argument.')
const text = await got(url, { resolveBodyOnly: true })
const links = cssUrls({ text, url })
links.forEach(({ url, normalizedUrl }) => console.log(normalizedUrl))
})()
Required
Type: string
The target URL(s) for extracting URLs referenced.
Required
Type: string
The
The target URL(s) for extracting URLs referenced.
- html-urls – Get all urls from a HTML markup.
- xml-urls – Get all urls from a Feed/Atom/RSS/Sitemap xml markup.
css-urls © Kiko Beats, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.
kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats