JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 46249
  • Score
    100M100P100Q150094F
  • License MIT

Parse urls from css

Package Exports

  • css-url-parser
  • css-url-parser/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (css-url-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Introduction

Parse urls from css file

Version Downloads Node.js CI Coverage Status Code Climate

Installation

npm install css-url-parser

Usage

var parseCssUrls = require('css-url-parser');

var css = '@import "a.css"; .image { background-image: url(images/img.png); }';
var cssUrls = parseCssUrls(css);

console.log(cssUrls);   // [ 'a.css', 'images/img.png' ]

It ignores duplicated urls and base64 encoded resources. If no urls found empty array will be returned.