Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-single-charset

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-single-charset

A PostCSS plugin for popping first @charset rule up in CSS file

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

postcss-single-charset

A PostCSS plugin for popping first @charset rule up in CSS file

SYNOPSIS

Sometimes concatenated CSS file has @charset directive in the middle or has many @charset directives:

.foo {
  color: red;
}

@charset "Shift_JIS";

.bar {
  color: green;
}

@charset "Shift_JIS";

.baz {
  color: blue;
}

This PostCSS plugin fixes these invalid @charset like this:

@charset "Shift_JIS";

.foo {
  color: red;
}

.bar {
  color: green;
}

.baz {
  color: blue;
}

INSTALL

$ npm install postcss-single-charset

USAGE

var fs = require("fs");
var postcss = require("postcss");

var css = fs.readFileSync("input.css", "utf8");
postcss([
  require("postcss-single-charset")()
]).process(css).then(function (result) {
  fs.writeFileSync("output.css", result.css);
});

LICENSE

MIT: http://hail2u.mit-license.org/2015

Keywords

FAQs

Package last updated on 07 May 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc