sax
npmv1.6.1An evented streaming XML parser in JavaScript
Safe to adopt
Yes — sax scores well across adoption, maintenance, weight, supply chain, and licensing. 78.9M downloads per week and 2 known dependents. Last published 47 days ago. 6 releases in the last 2 years.
- AAdoption: grade A, Excellent.
78.9M downloads per week and 2 known dependents.
- AMaintenance: grade A, Excellent.
Last published 47 days ago. 6 releases in the last 2 years.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 60 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
BlueOak-1.0.0 — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding sax to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- node >=11.0.0
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the sax README.
var sax = require('./lib/sax'),
strict = true, // set to false for html-mode
parser = sax.parser(strict)
parser.onerror = function (e) {
// an error happened.
}
parser.ontext = function (t) {
// got some text. t is the string of text.
}
parser.onopentag = function (node) {
// opened a tag. node has "name" and "attributes"
}
parser.onattribute = function (attr) {Dependencies
Declared by sax v1.6.1. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (2)
Used by
Popular packages that depend on sax.
Relationship graph
Dependencies (left) and dependents (right) of sax.
Frequently installed together
A JavaScript text diff implementation.
BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
A modern CSS parser and stringifier with TypeScript support
Lightweight debugging utility for Node.js and the browser
Generates and consumes source maps
An XML builder for node.js
the most correct and second fastest glob implementation in JavaScript
Release history
6 releases in the last two years, typically about 52 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.6.1latest | 1 month ago | 60 KB | BlueOak-1.0.0 |
| 1.6.0 | 5 months ago | 60 KB | BlueOak-1.0.0 |
| 1.5.0 | 6 months ago | 56 KB | BlueOak-1.0.0 |
| 1.4.4 | 8 months ago | 55 KB | BlueOak-1.0.0 |
| 1.4.3 | 10 months ago | 55 KB | BlueOak-1.0.0 |
| 1.4.2 | 10 months ago | 55 KB | BlueOak-1.0.0 |
| 1.4.1 | 2 years ago | 55 KB | ISC |
| 1.4.0 | 2 years ago | 55 KB | ISC |
| 1.3.0 | 2 years ago | 54 KB | ISC |
| 1.2.4 | 9 years ago | — | ISC |
| 1.2.3 | 9 years ago | — | ISC |
| 1.2.2 | 9 years ago | — | ISC |
| 1.2.1 | 10 years ago | — | ISC |
| 1.1.6 | 10 years ago | — | ISC |
| 1.1.5 | 10 years ago | — | ISC |
Overview
sax is an npm package that an evented streaming XML parser in JavaScript. It is extremely widely used, with about 78.9M downloads per week and 2 known dependents in the graph. The latest version is 1.6.1, released under the BlueOak-1.0.0 license.
Who should use it
Teams working in the npm ecosystem who need an evented streaming XML parser in JavaScript and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (78.9M weekly downloads).
- Clear open-source license (BlueOak-1.0.0).
- Lean dependency tree (2 direct dependencies).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use sax?
Yes — sax scores well across adoption, maintenance, weight, supply chain, and licensing. 78.9M downloads per week and 2 known dependents. Last published 47 days ago. 6 releases in the last 2 years.
How do I install sax?
Run `npm install sax` to add sax to your npm project.
What license is sax released under?
sax is distributed under the BlueOak-1.0.0 license.
How popular is sax?
sax has approximately 78,878,411 downloads per week and 2 known dependent packages.
Is sax still maintained?
The most recent release of sax (v1.6.1) was published 1 month ago.
Does sax run install scripts?
No. sax does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.