🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

css-dependency

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-dependency

A css parser for getting imports from css code.

0.0.3
latest
Source
npm
Version published
Weekly downloads
1.8K
14.9%
Maintainers
0
Weekly downloads
 
Created
Source

css-dependency

A css parser for getting imports from css code.

npm install css-dependency
import { parse } from "css-dependency";

const imports = parse('@import "./example.css";');

assert.deepStrictEqual(imports.unwrap(), [
	{
		directive: "@import",
		module: "./util.css",
		raw: '@import "./util.css";',
	},
]);

Supported Syntax

@import "./example.css";
@import url("./something.css");
@import "./example.css" /* Conditions... */;

Tailwind Directives

In tailwindcss@v4 more @ directives were introduced that can result in additional dependencies for your css files. You can enable their detection by setting allowTailwindDirectives to true:

import { parse } from "css-dependency";

parse(code, { allowTailwindDirectives: true });

Supported Directives

["@plugin", "@config", "@reference"];

Keywords

css

FAQs

Package last updated on 17 Feb 2025

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