https://github.com/kikobeats/css-urls
Get all URLs referenced from stylesheet files
https://github.com/kikobeats/css-urls
Last synced: 4 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 (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-27T10:12:19.000Z (about 1 year ago)
- Last Synced: 2024-12-09T20:14:40.503Z (5 months ago)
- Language: JavaScript
- Size: 124 KB
- Stars: 6
- Watchers: 3
- 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)