https://github.com/kikobeats/css-urls
Get all URLs referenced from stylesheet files
https://github.com/kikobeats/css-urls
Last synced: 2 months ago
JSON representation
Get all URLs referenced from stylesheet files
- Host: GitHub
- URL: https://github.com/kikobeats/css-urls
- Owner: Kikobeats
- License: mit
- Created: 2018-07-22T19:06:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-09-05T06:25:01.000Z (4 months ago)
- Last Synced: 2025-10-07T14:34:48.998Z (3 months ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# css-urls

[](https://coveralls.io/github/Kikobeats/css-urls)
[](https://www.npmjs.org/package/css-urls)
> Get all URLs inside stylesheets
## Install
```bash
$ npm install css-urls --save
```
## Usage
```js
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))
})()
```
## API
### cssUrls({url, text})
#### url
*Required*
Type: `string`
The target URL(s) for extracting URLs referenced.
#### text
*Required*
Type: `string`
The
The target URL(s) for extracting URLs referenced.
## Related
- [html-urls](https://github.com/Kikobeats/html-urls) – Get all urls from a HTML markup.
- [xml-urls](https://github.com/Kikobeats/xml-urls) – Get all urls from a Feed/Atom/RSS/Sitemap xml markup.
## License
**css-urls** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/Kikobeats/css-urls/blob/master/LICENSE.md) License.
Authored and maintained by Kiko Beats with help from [contributors](https://github.com/Kikobeats/css-urls/contributors).
> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/Kikobeats) · Twitter [@Kikobeats](https://twitter.com/Kikobeats)