# resolve-css-import-urls

> Turn css @import statements into full urls

Latest version **4.0.0** (published 2020-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install resolve-css-import-urls
pnpm add resolve-css-import-urls
yarn add resolve-css-import-urls
bun add resolve-css-import-urls
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2020-12-08 |
| First published | 2014-12-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2814 |
| Author | John Otander |
| Maintainers | johno |
| Keywords | css, css-import, import, url, resolve |

## Links

- npm: https://www.npmjs.com/package/resolve-css-import-urls
- Repository: https://github.com/cssstats/cssstats
- Homepage: https://github.com/cssstats/cssstats#readme
- Issues: https://github.com/cssstats/cssstats/issues
- npm.io page: https://npm.io/package/resolve-css-import-urls

## Dependencies (4)

- [is-url](https://npm.io/package/is-url.md) ^1.2.2
- [is-present](https://npm.io/package/is-present.md) ^1.0.0
- [get-imports](https://npm.io/package/get-imports.md) ^1.0.0
- [get-css-urls](https://npm.io/package/get-css-urls.md) 1.0.1

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 4.0.0 (latest) — 2020-12-08
- 3.5.0 — 2020-11-03
- 1.0.0 — 2016-11-11
- 0.0.3 — 2014-12-11
- 0.0.2 — 2014-12-05
- 0.0.1 — 2014-12-03

## README

# resolve-css-import-urls [![Build Status](https://travis-ci.org/cssstats/resolve-css-import-urls.svg?branch=master)](https://travis-ci.org/cssstats/resolve-css-import-urls) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

Parse css import statements (`@import url(bar.css)`) in a string and return the full urls (`http://foo.com/bar.css`).

Support for the following `@import` [syntax](https://developer.mozilla.org/en-US/docs/Web/CSS/@import):

```css
@import url("fineprint.css") print;
@import 'custom.css' projection;
@import "custom.css";
```

TODO: Support the following

```css
@import "common.css" screen, projection;
@import url('landscape.css') screen and (orientation:landscape);
@import url("bluish.css") projection, tv;
```

## Installation

```
npm i --save resolve-css-import-urls
```

## Usage

```javascript
const resolveCssImportUrls = require('resolve-css-import-urls')

resolveCssImportUrls('http://example.com/css', 'url(foo.css); lksjhlksjhdf url(../bar.css);')
// => ['http://example.com/css/foo.css', 'http://example.com/bar.css']

resolveCssImportUrls("(foo.css); lksjhlksjhdf") // => []
```

## License

MIT

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Crafted with <3 by [John Otander](http://johnotander.com).

***

> This package was initially generated with [yeoman](http://yeoman.io) and the [p generator](https://github.com/johnotander/generator-p.git).

---
_Source: https://npm.io/package/resolve-css-import-urls · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
