# postcss-safe-parser

> Fault-tolerant CSS parser for PostCSS

Latest version **7.1.0** (published 2026-09-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-safe-parser
pnpm add postcss-safe-parser
yarn add postcss-safe-parser
bun add postcss-safe-parser
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 7.1.0 |
| Published | 2026-09-04 |
| First published | 2015-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18.0 |
| Dependencies | 0 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 127 |
| Author | Andrey Sitnik |
| Maintainers | ai |
| Keywords | css, fault tolerant, parser, postcss, postcss-syntax |

## Links

- npm: https://www.npmjs.com/package/postcss-safe-parser
- Repository: https://github.com/postcss/postcss-safe-parser
- Homepage: https://github.com/postcss/postcss-safe-parser#readme
- Issues: https://github.com/postcss/postcss-safe-parser/issues
- Funding: https://opencollective.com/postcss/
- npm.io page: https://npm.io/package/postcss-safe-parser

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 7.1.0 (latest) — 2026-09-04
- 7.0.1 — 2024-10-04
- 7.0.0 — 2023-10-08
- 6.0.0 — 2021-06-14
- 5.0.2 — 2020-09-27
- 5.0.1 — 2020-09-16
- 5.0.0 — 2020-09-15
- 4.0.2 — 2020-02-08
- 4.0.1 — 2018-07-16
- 4.0.0 — 2018-07-16
- 3.0.1 — 2017-07-14
- 3.0.0 — 2017-05-07
- 2.0.1 — 2017-04-05
- 2.0.0 — 2016-09-07
- 1.0.7 — 2016-02-29
- … 7 more at https://npm.io/package/postcss-safe-parser/versions

## README

# PostCSS Safe Parser

<img align="right" width="135" height="95"
     title="Philosopher’s stone, logo of PostCSS"
     src="https://postcss.org/logo-leftp.svg">

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].

[Autoprefixer demo]: http://simevidas.jsbin.com/gufoko/quiet
[Browserhacks]: http://browserhacks.com/
[PostCSS]: https://github.com/postcss/postcss

---

<img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" />  PostCSS Safe Parser is built by <b><a href="https://evilmartians.com/">Evil Martians</a></b>, an American design and engineering consultancy for <b>developer tools, AI, and cybersecurity startups</b>.

---

## Docs
Read full docs **[here](https://github.com/postcss/postcss-safe-parser#readme)**.

---
_Source: https://npm.io/package/postcss-safe-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
