detective-postcss
TypeScript icon, indicating that this package has built-in type declarations

7.0.0 • Public • Published

node-detective-postcss

build npm version npm downloads

Find the dependencies of a CSS file (PostCSS dialect)

Supports @import and @value ... from.

npm install postcss detective-postcss

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

Usage

const fs = require('fs');
const detective = require('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

MIT

Releasing

  • Bump the version of package.json to a meaningful version for the changes since the last release (we follow semver).
  • To do a dry-run of the release and what would go out in the package you can manually execute the npm-publish workflow on the main branch. It will do a dry-run publish (not actually publish the new version).
  • Draft a new release in the github project - please use a tag named vX.X.X (where X.X.X is the new to-be-releases semver of the package - please add as many detail as possible to the release description.
  • Once you're ready, Publish the release. Publishing will trigger the npm-publish workflow on the tag and do the actual publish to npm.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 7.0.0
    664
    • latest

Version History

Package Sidebar

Install

npm i detective-postcss

Weekly Downloads

1,304,719

Version

7.0.0

License

MIT

Unpacked Size

8.56 kB

Total Files

6

Last publish

Collaborators

  • joscha
  • xhmikosr