# css-imports

> find all @import in css

Latest version **0.3.1** (published 2014-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install css-imports
pnpm add css-imports
yarn add css-imports
bun add css-imports
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2014-08-28 |
| First published | 2014-03-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | popomore |
| Maintainers | popomore |

## Links

- npm: https://www.npmjs.com/package/css-imports
- Repository: https://github.com/popomore/css-imports
- Issues: https://github.com/popomore/css-imports/issues
- npm.io page: https://npm.io/package/css-imports

## Dependencies (1)

- [strip-comments](https://npm.io/package/strip-comments.md) ~0.1.6

## Recent versions

- 0.3.1 (latest) — 2014-08-28
- 0.3.0 — 2014-05-22
- 0.2.1 — 2014-05-13
- 0.2.0 — 2014-04-10
- 0.1.0 — 2014-03-31

## README

# css-imports [![Build Status](https://travis-ci.org/popomore/css-imports.png?branch=master)](https://travis-ci.org/popomore/css-imports) [![Coverage Status](https://coveralls.io/repos/popomore/css-imports/badge.png?branch=master)](https://coveralls.io/r/popomore/css-imports?branch=master) 

find all @import in css

---

## Install

```
$ npm install css-imports -g
```

## Usage

Css file a.css

```
@import url("./b.css");
@import url("c.css");
```

Run code

```
var imports = require('css-imports');
imports(fs.readFileSync('a.css'));
```

return

```
[
  {
    string: '@import url("./b.css");',
    path: './b.css',
    index: 0
  },
  {
    string: '@import url("c.css");',
    path: 'c.css',
    index: 24
  }
]
```

You can add a callback to replace css file

```
imports(fs.readFileSync('a.css'), function(item) {
  return '@import url("' + resolve(item.path) + '");';
});
```

## LISENCE

Copyright (c) 2014 popomore. Licensed under the MIT license.

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