work.suroh.tk/node_modules/detective-postcss
suroh 410082595a init 11ty commit 2019-12-02 13:22:45 +01:00
..
dist init 11ty commit 2019-12-02 13:22:45 +01:00
src init 11ty commit 2019-12-02 13:22:45 +01:00
tests init 11ty commit 2019-12-02 13:22:45 +01:00
.travis.yml init 11ty commit 2019-12-02 13:22:45 +01:00
LICENSE init 11ty commit 2019-12-02 13:22:45 +01:00
README.md init 11ty commit 2019-12-02 13:22:45 +01:00
package.json init 11ty commit 2019-12-02 13:22:45 +01:00
tsconfig.json init 11ty commit 2019-12-02 13:22:45 +01:00
yarn.lock init 11ty commit 2019-12-02 13:22:45 +01:00

README.md

node-detective-postcss Build Status

Find the dependencies of a CSS file (postCSS dialects)

Supports @import and @value ... from.

npm install --save detective-postcss

It's the CSS (PostCSS dialect) counterpart to detective, detective-amd, detective-es6, detective-sass, detective-scss.

Usage

import fs from 'fs';
import detective from 'detective-postcss';

const content = fs.readFileSync('styles.css', 'utf8');

// list of imported file names (ex: 'bla.css', 'foo.css', etc.)
const dependencies = detective(content);

// or to also detect any url() references to images, fonts, etc.
const allDependencies = detective(content, { url: true });

License

Apache 2.0