obj-props is a utility package that provides a structured JSON file containing lists of properties for various built-in JavaScript objects. It offers a static dataset, mapping JavaScript constructor names (e.g., "Array", "Boolean", "Object") to an array of their respective property names. The current stable version is 2.0.0. Due to its nature as a static data provider, the package follows an infrequent release cadence, with new versions primarily released when new ECMAScript features introduce new built-in properties or when the underlying data source is updated. It differentiates itself by being a pre-generated, easily consumable JSON resource, forked from Sindre Sorhus's `proto-props`, making it suitable for environments where runtime reflection or dynamic property enumeration might be undesirable or overkill. This makes it valuable for static analysis, documentation, or environments with restricted execution contexts.
npm install obj-propsVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing the obj-props object and accessing properties for various built-in JavaScript constructors, including safe iteration.
Upgrade your Node.js environment to version 18.0.0 or later to ensure compatibility.
Review the `obj-props.json` file and the package's changelog, especially when migrating from `proto-props`, to identify any breaking changes in data or behavior.
Consult the `obj-props` release notes or directly inspect the `obj-props.json` file when upgrading from a previous major version to understand any data structure changes.
Understand that the data is fixed for the installed package version. If you require dynamic reflection of an object's current properties at runtime, use `Object.getOwnPropertyNames()`, `Object.keys()`, or `Reflect.ownKeys()`.
Use the ES module `import` syntax: `import objProps from 'obj-props';`
Access `objProps` directly as an object, for example, `objProps.Array` or `Object.keys(objProps)`.
Access the property with optional chaining (`objProps.MyCustomObject?.propertyName`) or use a type assertion (`(objProps as Record<string, string[]>).MyCustomObject`) if you are confident it exists, or check `Object.keys(objProps)` for available properties. Remember it only contains built-in objects.
No dependency data recorded yet.