define-data-property
npmv1.1.4TypeScriptDefine a data property on an object. Will fall back to assignment in an engine without descriptors.
Overview
define-data-property is an npm package that define a data property on an object. Will fall back to assignment in an engine without descriptors. It is extremely widely used, with about 96.7M downloads per week and 2 known dependents in the graph. The latest version is 1.1.4, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need define a data property on an object. Will fall back to assignment in an engine without descriptors and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to minimize your dependency tree, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (96.7M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- Large dependency tree (30 direct dependencies) increases install size and audit surface.
Auto-generated from collected registry metadata. No external claims are inferred.
Relationship graph
Dependencies (left) and dependents (right) of define-data-property.
Dependencies
Dev (27)
Used by
Popular packages that depend on define-data-property.
Alternatives to define-data-property
`Object.defineProperty`, but not IE 8's broken one.
A robust, ES3 compatible, "has own property" predicate.
ES Object-related atoms: Object, ToObject, RequireObjectCoercible
Define a lazily evaluated property on an object
Which kind of boxed JS primitive is this?
`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.
An Esprima-compatible JavaScript parser built on Acorn
A query library for ECMAScript AST using a CSS selector like query language.
Merge objects using their property descriptors
ES spec-like internal slots
prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.
Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.
Frequently installed together
An AST-based pattern checker for JavaScript.
A simple cache for a few of the JS Error constructors.
string representations of objects in node and the browser
Does this JS environment support the `name` property on functions?
Implementation of Function.prototype.bind
Robustly `.call.bind()` a function
`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.
Get and robustly cache all JS language-level intrinsics at first require time
Version history
| Version | Published | License |
|---|---|---|
| 1.1.4latest | 2 years ago | MIT |
| 1.1.3 | 2 years ago | MIT |
| 1.1.2 | 2 years ago | MIT |
| 1.1.1 | 2 years ago | MIT |
| 1.1.0 | 2 years ago | MIT |
| 1.0.1 | 2 years ago | MIT |
| 1.0.0 | 2 years ago | MIT |
Maintainers
Funding
Frequently asked questions
How do I install define-data-property?
Run `npm install define-data-property` to add define-data-property to your npm project.
What license is define-data-property released under?
define-data-property is distributed under the MIT license.
How popular is define-data-property?
define-data-property has approximately 96,677,693 downloads per week and 2 known dependent packages.