New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

postcss-ast-dependencies

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-ast-dependencies

Inspects postcss ASTs for dependency identifiers

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

postcss-ast-dependencies

Inspects postcss ASTs for dependency identifiers.

Install

npm install --save postcss-ast-dependencies

Example

import postcss from 'postcss';
import postcssAstDependencies from 'postcss-ast-dependencies';

const ast = postcss.parse(`
  @import './foo.css';

  .bar {
    background-image: url('./bar.png');
  }
`);

const deps = postcssAstDependencies(ast);

console.log(deps.map(dep => dep.source);
// ['./foo.css', './bar.png']

Notes

Lists of objects are returned, where each object has the value of the identifier as a source prop. Rather than simply returning lists of strings, we use objects as it leaves open the potential for more contextual information to be provided in a backwards-compatible manner.

FAQs

Package last updated on 15 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts