trivial and outdated NPM packages

define-property outdated npm logo

Reimplements the native Object.defineProperty() method.

Weekly Downloads
53,771,360
Dependencies
8 (6 distinct)
Latest Release
8 years ago
This dependency re-creates a native JavaScript API. It is recommended to use the native API instead
Outdated
natively supported
since 13 years (chrome, firefox, safari, nodejs)

Dependency Tree

  • define-property @2.0.2 (8)
    • is-descriptor @1.0.3 (6)
      • is-accessor-descriptor @1.0.1 (2)
        • hasown @2.0.2 (1)
          • function-bind @1.1.2
      • is-data-descriptor @1.0.1 (2)
        • hasown @2.0.2 (1)
          • function-bind @1.1.2
    • isobject @3.0.1

About

This dependency reimplements the native Object.defineProperty() method. It’s supported by all modern browsers and Node.js versions since ES5 (2009).

// Define a non-enumerable property on an object
const obj = {};
Object.defineProperty(obj, "foo", {
    value: "bar",
    enumerable: false
});

console.log(obj.foo); // "bar"
console.log(Object.keys(obj)); // []

Additionally it needs 7 additional dependencies to do what Object.defineProperty can do natively.