Skip to content

website-scraper/node-css-url-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.