Registry / serialization / amp-keys

amp-keys

JSON →
library1.0.1jsnpmunverified

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-keys
INSTALL
IMPORT
SIG · AMP-KEYS
A
amp-keys
serializationjavascriptv1.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

keys
const keys = require('amp-keys');
import { keys } from 'amp-keys';
This package is CommonJS-only and exports the function directly as the module.exports. Attempting to use named ESM imports will likely result in an undefined value or an error in Node.js environments unless transpiled.
keys (via destructuring)
const getObjectKeys = require('amp-keys'); const keys = getObjectKeys; // The function is the default export
const { keys } = require('amp-keys');
The package likely exports the function as the module's default export (module.exports = function), not as a named export. Destructuring will fail as 'keys' would be undefined on the module object.

Demonstrates how to import the `keys` function using CommonJS `require` and use it to retrieve the enumerable own property names of various objects.

const getKeys = require('amp-keys'); const myObject = { name: 'Alice', age: 30, city: 'New York' }; // Get own enumerable property names const objectKeys = getKeys(myObject); console.log('Keys of myObject:', objectKeys); // Expected: ['name', 'age', 'city'] const emptyObject = {}; const emptyKeys = getKeys(emptyObject); console.log('Keys of emptyObject:', emptyKeys); // Expected: [] // Demonstrates Object.keys-like behavior (does not include prototype properties) function ProtoExample() { this.ownProperty = 'foo'; } ProtoExample.prototype.protoProperty = 'bar'; const instance = new ProtoExample(); const instanceKeys = getKeys(instance); console.log('Keys of instance (own properties only):', instanceKeys); // Expected: ['ownProperty']
Debug
Known issues
breakingThis package is effectively abandoned. There will be no further updates, bug fixes, or security patches. It is not compatible with modern JavaScript module systems (ESM) without specific CommonJS interop mechanisms or transpilation.
fix
Migrate to native `Object.keys()` for all modern JavaScript environments. For extremely old environments, consider a modern polyfill or bundler configuration.
affects: >=1.0.1
gotchaThe functionality provided by `amp-keys` is natively available in all modern JavaScript environments (ES5 and above) via `Object.keys()`. Using this package introduces unnecessary overhead and a dependency for already available functionality.
fix
Replace `require('amp-keys')(obj)` with `Object.keys(obj)` directly.
affects: >=1.0.1
gotchaThis package is a CommonJS module. Direct ES module `import` statements will not work as expected in a native ESM context (e.g., Node.js with type: 'module') unless transpiled or explicit CommonJS interop is used, which is not recommended for an abandoned package.
fix
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.
affects: >=1.0.1
Errors
Common errors & fixes
TypeError: (0 , amp_keys_1.keys) is not a function
Attempting to use ES module named import syntax (`import { keys } from 'amp-keys';`) when the package is a CommonJS module exporting a single function as its default.
fix
Use CommonJS `require` to import the default export: `const keys = require('amp-keys');`
TypeError: ampKeys is not a function
Incorrectly destructuring the CommonJS module import, assuming a named export when the module exports a single function as its default (e.g., `const { ampKeys } = require('amp-keys');`).
fix
The module exports the function directly. Import it as a single variable: `const ampKeys = require('amp-keys');`
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
24
OpenAI (training)
1
Resources
amp-keys — npm install amp-keys · libregistry