Socket
Socket
Sign inDemoInstall

css-urls

Package Overview
Dependencies
189
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    css-urls

Get all URLs inside stylesheets


Version published
Weekly downloads
584
increased by139.34%
Maintainers
1
Install size
61.3 MB
Created
Weekly downloads
 

Readme

Source

css-urls

Last version Coverage Status NPM Status

Get all URLs inside stylesheets

Install

$ npm install css-urls --save

Usage

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.

  • html-urls – Get all urls from a HTML markup.
  • xml-urls – Get all urls from a Feed/Atom/RSS/Sitemap xml markup.

License

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

Keywords

FAQs

Last updated on 27 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc