Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/website-scraper/node-css-url-parser
Parse urls from css
https://github.com/website-scraper/node-css-url-parser
css hacktoberfest javascript nodejs parseurl
Last synced: 4 days ago
JSON representation
Parse urls from css
- Host: GitHub
- URL: https://github.com/website-scraper/node-css-url-parser
- Owner: website-scraper
- License: mit
- Created: 2015-04-24T19:34:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-12-09T20:32:53.000Z (25 days ago)
- Last Synced: 2024-12-23T18:11:59.079Z (11 days ago)
- Topics: css, hacktoberfest, javascript, nodejs, parseurl
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/css-url-parser
- Size: 218 KB
- Stars: 24
- Watchers: 4
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Introduction
Parse urls from css file[![Version](https://img.shields.io/npm/v/css-url-parser.svg?style=flat)](https://www.npmjs.org/package/css-url-parser)
[![Downloads](https://img.shields.io/npm/dm/css-url-parser.svg?style=flat)](https://www.npmjs.org/package/css-url-parser)
[![Node.js CI](https://github.com/website-scraper/node-css-url-parser/actions/workflows/node.js.yml/badge.svg?branch=master)](https://github.com/website-scraper/node-css-url-parser/)
[![Coverage Status](https://coveralls.io/repos/website-scraper/node-css-url-parser/badge.svg)](https://coveralls.io/r/website-scraper/node-css-url-parser)
[![Code Climate](https://codeclimate.com/github/website-scraper/node-css-url-parser/badges/gpa.svg)](https://codeclimate.com/github/website-scraper/node-css-url-parser)## Installation
```
npm install css-url-parser
```## Usage
```javascript
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.