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

npm-css

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-css

Require css from npm

latest
Source
npmnpm
Version
0.2.3
Version published
Weekly downloads
381
214.88%
Maintainers
1
Weekly downloads
 
Created
Source

npm-css

Require css from node modules.

Syntax

@import "typeahead";

@import "./foo.css";
@import "./bar/baz.css";

.foo {
    color: red
}

npm-css reads css imports in the format of @import " ... " and inlines the CSS at that path for you. It also understands node modules.

If you @import a folder it will try to look for a package.json file or read index.css by default. See the package.json section below.

CLI

To build a single css file from an entry.css with @import statements.

npm-css entry.css -o bundle.css

API

If you want to build css files on the fly.

var npmcss = require('npm-css');
var css = npmcss(/path/to/file);

package.json

You can specify the stylesheet for your module by adding a "style" field to your package.json file. This works similarly to the "main" field.

Installation

npm install npm-css

MIT Licenced

FAQs

Package last updated on 20 Oct 2013

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