amp-keys is a minimalist JavaScript utility module, currently at version 1.0.1. It provides a single `keys` function designed to mimic the functionality of `Object.keys`. This package originates from the Ampersand.js project, an older, modular client-side framework that emphasized loosely coupled components. Given that `amp-keys` was last published many years ago (approximately nine years ago, with its parent Ampersand.js last seeing activity around December 2022) and the broader Ampersand.js ecosystem appears to be largely unmaintained, this module can be considered stable but effectively abandoned. Its primary utility was likely for older JavaScript environments that lacked native `Object.keys` support or to provide API consistency within the Ampersand.js application architecture. For modern JavaScript development, relying on the native `Object.keys` is universally preferred, rendering this package largely redundant. Its release cadence was minimal, likely only seeing updates to align with the Ampersand.js framework's initial stable releases.
npm install amp-keysVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import the `keys` function using CommonJS `require` and use it to retrieve the enumerable own property names of various objects.
Migrate to native `Object.keys()` for all modern JavaScript environments. For extremely old environments, consider a modern polyfill or bundler configuration.
Replace `require('amp-keys')(obj)` with `Object.keys(obj)` directly.If absolutely necessary to use in an ESM context, wrap it in a compatibility layer or use dynamic `import()` for CJS modules (e.g., `const getKeys = await import('amp-keys'); const keys = getKeys.default;`), but migrating to `Object.keys()` is strongly advised.Use CommonJS `require` to import the default export: `const keys = require('amp-keys');`The module exports the function directly. Import it as a single variable: `const ampKeys = require('amp-keys');`No dependency data recorded yet.