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

mensch

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mensch

A decent CSS parser

  • 0.3.4
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
970K
increased by12.32%
Maintainers
2
Weekly downloads
 
Created

What is mensch?

The mensch npm package is a CSS parser and stringifier. It allows you to parse CSS into an abstract syntax tree (AST) and then stringify it back into CSS. This can be useful for manipulating CSS programmatically.

What are mensch's main functionalities?

Parsing CSS

This feature allows you to parse a CSS string into an abstract syntax tree (AST). The AST can then be manipulated programmatically.

const mensch = require('mensch');
const css = 'body { color: red; }';
const ast = mensch.parse(css);
console.log(ast);

Stringifying CSS

This feature allows you to convert an abstract syntax tree (AST) back into a CSS string. This is useful after you have made programmatic changes to the AST.

const mensch = require('mensch');
const ast = {
  type: 'stylesheet',
  stylesheet: {
    rules: [
      {
        type: 'rule',
        selectors: ['body'],
        declarations: [
          {
            type: 'declaration',
            property: 'color',
            value: 'red'
          }
        ]
      }
    ]
  }
};
const css = mensch.stringify(ast);
console.log(css);

Other packages similar to mensch

Keywords

FAQs

Package last updated on 09 Nov 2019

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