jsesc
npmv3.1.0Given some data, jsesc returns the shortest possible stringified & ASCII-safe representation of that data.
Adopt with care
jsesc is usable, with caveats. Last published 637 days ago.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- CMaintenance: grade C, Fair — worth a look.
Last published 637 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 32 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — 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 jsesc 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 >=6
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the jsesc README.
const jsesc = require('jsesc');jsesc vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| jsescthis page | 0 | 1 | MIT | 1 year ago |
| escape-string-regexp | 316.5M | 8 | MIT | 1 day ago |
| fast-json-stable-stringify | 137.5M | 2 | MIT | 1 day ago |
| diff | 124.1M | 4 | BSD-3-Clause | 1 day ago |
| json-stable-stringify-without-jsonify | 72.1M | 1 | MIT | 1 day ago |
| json-stringify-safe | 36.4M | 1 | ISC | 1 day ago |
Dependencies
Declared by jsesc v3.1.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (9)
Used by
Popular packages that depend on jsesc.
Relationship graph
Dependencies (left) and dependents (right) of jsesc.
Frequently installed together
Generate source maps
Encode/decode sourcemap mappings
A JavaScript parser
Babel Types is a Lodash-esque utility library for AST nodes
Trace the original position through a source map
Transform TypeScript into ES.next
TypeScript definitions for jsesc
Release history
1 release in the last two years, typically about 70 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 3.1.0latest | 1 year ago | 32 KB | MIT |
| 3.0.2 | 5 years ago | 31 KB | MIT |
| 3.0.1 | 6 years ago | 31 KB | MIT |
| 3.0.0 | 6 years ago | 31 KB | MIT |
| 2.5.2 | 7 years ago | 31 KB | MIT |
| 2.5.1 | 9 years ago | — | MIT |
| 2.5.0 | 9 years ago | — | MIT |
| 2.4.0 | 9 years ago | — | MIT |
| 2.3.0 | 9 years ago | — | MIT |
| 2.2.0 | 10 years ago | — | MIT |
| 2.1.0 | 10 years ago | — | MIT |
| 2.0.0 | 10 years ago | — | MIT |
| 1.3.0 | 10 years ago | — | MIT |
| 1.2.1 | 10 years ago | — | MIT |
| 1.2.0 | 10 years ago | — | MIT |
Overview
jsesc is an npm package that given some data, jsesc returns the shortest possible stringified & ASCII-safe representation of that data. It has 1 known dependents in the graph. The latest version is 3.1.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need given some data, jsesc returns the shortest possible stringified & ASCII-safe representation of that data and value a focused 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
- Clear open-source license (MIT).
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 jsesc?
jsesc is usable, with caveats. Last published 637 days ago.
How do I install jsesc?
Run `npm install jsesc` to add jsesc to your npm project.
What license is jsesc released under?
jsesc is distributed under the MIT license.
How popular is jsesc?
npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on jsesc.
Is jsesc still maintained?
The most recent release of jsesc (v3.1.0) was published 1 year ago.
Does jsesc run install scripts?
No. jsesc does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.