define-data-property
npmv1.1.4TypeScriptDefine a data property on an object. Will fall back to assignment in an engine without descriptors.
Adopt with care
define-data-property is usable, with caveats. Last published 939 days ago.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- DMaintenance: grade D, Poor — a real concern.
Last published 939 days ago.
- AWeight: grade A, Excellent.
Pulls in 3 transitive packages, about 62 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 define-data-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.
Licenses in the dependency tree
Every license you inherit by installing define-data-property, not just its own. Check this before a legal review, not after.
Compatibility
- Node.js
- node >= 0.4
- Module format
- CommonJS only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the define-data-property README.
var defineDataProperty = require('define-data-property');
var assert = require('assert');
var obj = {};
defineDataProperty(obj, 'key', 'value');
defineDataProperty(
obj,
'key2',
'value',
true, // nonEnumerable, optional
false, // nonWritable, optional
true, // nonConfigurable, optional
false // loose, optional
);define-data-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 |
|---|---|---|---|---|
| define-data-propertythis page | 0 | 2 | MIT | 2 years ago |
| es-define-property | 131.3M | 4 | MIT | 1 day ago |
| which-boxed-primitive | 0 | 1 | MIT | 1 day ago |
| es-object-atoms | 0 | 1 | MIT | 1 day ago |
| gopd | 0 | 7 | MIT | 1 day ago |
| hasown | 0 | 8 | MIT | 1 day ago |
Dependencies
Declared by define-data-property v1.1.4. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (27)
Used by
Popular packages that depend on define-data-property.
Relationship graph
Dependencies (left) and dependents (right) of define-data-property.
Frequently installed together
An AST-based pattern checker for JavaScript.
string representations of objects in node and the browser
A simple cache for a few of the JS Error constructors.
Robustly `.call.bind()` a function
Does this JS environment support the `name` property on functions?
Get and robustly cache all JS language-level intrinsics at first require time
Implementation of Function.prototype.bind
`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.
Release history
No releases in the last two years, typically about 7 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.1.4latest | 2 years ago | 30 KB | MIT |
| 1.1.3 | 2 years ago | 30 KB | MIT |
| 1.1.2 | 2 years ago | 30 KB | MIT |
| 1.1.1 | 2 years ago | 29 KB | MIT |
| 1.1.0 | 3 years ago | 39 KB | MIT |
| 1.0.1 | 3 years ago | 37 KB | MIT |
| 1.0.0 | 3 years ago | 23 KB | MIT |
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 has 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 focused 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
- 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.
Maintainers
Funding
Frequently asked questions
Should I use define-data-property?
define-data-property is usable, with caveats. Last published 939 days ago.
How do I install define-data-property?
Run `npm install define-data-property` to add define-data-property to your npm project.
How many dependencies does define-data-property have?
define-data-property declares 30 direct dependencies and pulls in 3 packages in total once its runtime tree is resolved totalling about 62 KB on disk.
What license is define-data-property released under?
define-data-property is distributed under the MIT license.
How popular is define-data-property?
npm does not publish download counts. Within PackageGraph's crawl, 2 known packages depend on define-data-property.
Is define-data-property still maintained?
The most recent release of define-data-property (v1.1.4) was published 2 years ago.
Does define-data-property run install scripts?
No. define-data-property does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.