es-define-property
npmv1.0.1TypeScript`Object.defineProperty`, but not IE 8's broken one.
Adopt with care
es-define-property is usable, with caveats. Last published 642 days ago.
- AAdoption: grade A, Excellent.
131.3M downloads per week and 4 known dependents.
- CMaintenance: grade C, Fair — worth a look.
Last published 642 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 10.0 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 es-define-property 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 >= 0.4
- Module format
- CommonJS only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the es-define-property README.
const assert = require('assert');
const $defineProperty = require('es-define-property');
if ($defineProperty) {
assert.equal($defineProperty, Object.defineProperty);
} else if (Object.defineProperty) {
assert.equal($defineProperty, false, 'this is IE 8');
} else {
assert.equal($defineProperty, false, 'this is an ES3 engine');
}es-define-property 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 |
|---|---|---|---|---|
| es-define-propertythis page | 131.3M | 4 | MIT | 1 year ago |
| define-data-property | 0 | 2 | MIT | 1 day ago |
| hasown | 0 | 8 | MIT | 1 day ago |
| which-boxed-primitive | 0 | 1 | MIT | 1 day ago |
| gopd | 0 | 7 | MIT | 1 day ago |
| es-object-atoms | 0 | 1 | MIT | 1 day ago |
Dependencies
Declared by es-define-property v1.0.1. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (15)
Used by
Popular packages that depend on es-define-property.
Robustly `.call.bind()` a function
A querystring parser that supports nesting and arrays, with a depth limit
Get and robustly cache all JS language-level intrinsics at first require time
Define a data property on an object. Will fall back to assignment in an engine without descriptors.
Relationship graph
Dependencies (left) and dependents (right) of es-define-property.
Frequently installed together
An AST-based pattern checker for JavaScript.
string representations of objects in node and the browser
Modern Buffer API polyfill without footguns
A robust, ES3 compatible, "has own property" predicate.
the most correct and second fastest glob implementation in JavaScript
A simple cache for a few of the JS Error constructors.
Store information about any JS value in a side channel. Uses WeakMap if available.
Convert character encodings in pure javascript.
Runtime typescript and ESM support for Node.js
`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.
Helper functions around Function call/apply/bind, for use in `call-bind`
ES Math-related intrinsics and helpers, robustly cached.
Release history
1 release in the last two years.
| Version | Published | Size | License |
|---|---|---|---|
| 1.0.1latest | 1 year ago | 10.0 KB | MIT |
| 1.0.0 | 2 years ago | 12 KB | MIT |
Overview
es-define-property is an npm package that `Object.defineProperty`, but not IE 8's broken one. It is extremely widely used, with about 131.3M downloads per week and 4 known dependents in the graph. The latest version is 1.0.1, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need `Object.defineProperty`, but not IE 8's broken one and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (131.3M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use es-define-property?
es-define-property is usable, with caveats. Last published 642 days ago.
How do I install es-define-property?
Run `npm install es-define-property` to add es-define-property to your npm project.
What license is es-define-property released under?
es-define-property is distributed under the MIT license.
How popular is es-define-property?
es-define-property has approximately 131,257,269 downloads per week and 4 known dependent packages.
Is es-define-property still maintained?
The most recent release of es-define-property (v1.0.1) was published 1 year ago.
Does es-define-property run install scripts?
No. es-define-property does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.