Socket
Socket
Sign inDemoInstall

postcss-safe-parser

Package Overview
Dependencies
4
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    postcss-safe-parser

Fault-tolerant CSS parser for PostCSS


Version published
Maintainers
1
Install size
5.29 kB
Created

Package description

What is postcss-safe-parser?

The postcss-safe-parser package is a fault-tolerant CSS parser that can handle CSS with syntax errors. It is designed to be used with PostCSS, a tool for transforming CSS with JavaScript plugins. The safe parser can parse CSS files and recover from syntax errors gracefully, allowing developers to work with CSS that may not be perfectly formatted or may contain mistakes.

What are postcss-safe-parser's main functionalities?

Fault-tolerant CSS parsing

This feature allows developers to parse CSS with syntax errors without stopping the process. The provided code sample demonstrates how to use postcss-safe-parser with PostCSS to process a CSS string.

const postcss = require('postcss');
const safeParser = require('postcss-safe-parser');

postcss()
  .process('a { color: red; }', { parser: safeParser })
  .then(result => {
    console.log(result.css);
  });

Other packages similar to postcss-safe-parser

Readme

Source

PostCSS Safe Parser

A fault-tolerant CSS parser for PostCSS, which will find & fix syntax errors, capable of parsing any input. It is useful for:

  • Parse legacy code with many hacks. For example, it can parse all examples from Browserhacks.
  • Works with demo tools with live input like Autoprefixer demo.
Sponsored by Evil Martians

Docs

Read full docs here.

Keywords

FAQs

Last updated on 08 Oct 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc