New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

css-zero-beautify

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

css-zero-beautify

Friendly and forgiving CSS/SASS/LESS beautifier

  • 2.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

css-zero-beautify

Friendly and forgiving CSS/SASS/LESS beautifier with lots of tests. Memory-efficient and Web Worker compatible.

This is a work in progress. Don't use it yet!

Features

  • Supports CSS/SASS/LESS.
  • Zero-copy

Usage

import Beautify, { OUTPUT_FORMATS } from 'css-zero-beautifier';
const css = 'text selector1, text selector2 { prop; prop2 { value } /* comment */ }';

let result = Beautify(css);
// result is,
//
// text selector1,
// text selector2 {
//   prop;
//   prop2 {
//     value;
//   }
//   /* comment */
// }

result = Beautify(css, { output: OUTPUT_FORMATS.html });
// result is,
//
// <span class="b-selector">text selector1</span><span class="b-comma">,</span><br/>
// <span class="b-selector">text selector2</span> <span class="b-open-rule">{</span><br/>
//  &nbsp;<span class="b-prop">prop</span><span class="b-prop-close">;</span><br/>
//  &nbsp;<span class="b-selector">prop2</span> <span class="b-open-rule">{</span><br/>
//  &nbsp; &nbsp;<span class="b-prop">value</span><span class="b-prop-close">;</span><br/>
//  &nbsp;<span class="b-close-rule">}</span><br/>
//  &nbsp;<span class="b-comment">/* comment */</span><br/>
// <span class="b-close-rule">}</span><br/>

8KB gzipped (that includes all deps).

Just want a lexer? Try css-zero-lexer.


Part of XML-Zero.js

Keywords

FAQs

Package last updated on 24 Mar 2018

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