canirequire

canirequireCommonJS › reflect.getprototypeof

Is reflect.getprototypeof ESM-only? Can you require() it?

An ES2015 mostly-spec-compliant `Reflect.getPrototypeOf` sham/polyfill/replacement that works in as many engines as possible

Last verified Sep 9, 2026 against reflect.getprototypeof@1.0.10. JSON

CommonJS CommonJS — require() works on every Node.js version

reflect.getprototypeof ships CommonJS only. require("reflect.getprototypeof") works everywhere. import "reflect.getprototypeof" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

Latest
1.0.10 (Jan 2, 2025)
Module format
CommonJS
Last CommonJS version
1.0.10
Native ESM since
1.0.0
TypeScript types
None
Node engines
>= 0.4
Weekly downloads
69.0M
License
MIT

Does reflect.getprototypeof@1.0.10 actually load? Runtime test results

Installed and executed on Sep 9, 2026 with require("reflect.getprototypeof") from a CommonJS file and import "reflect.getprototypeof" from an ES module.

Runtimerequire("reflect.getprototypeof")import "reflect.getprototypeof"
Node.js 18✓ works✓ works
Node.js 20✓ works✓ works
Node.js 22✓ works✓ works
Node.js 24✓ works✓ works
Node.js 26✓ works✓ works
Bun 1.4✓ works✓ works

How to import reflect.getprototypeof

ES modules (import)

import reflectGetprototypeof from "reflect.getprototypeof";

Named imports from a CommonJS package only work when Node.js can statically detect them. If a named import fails, use the default import and destructure.

CommonJS (require)

const reflectGetprototypeof = require("reflect.getprototypeof");

Module format by version

Derived from the type, main and exports fields of every stable release on npm (11 versions; the newest 11 shown).

VersionsFormatFirst published
1.0.6 – 1.0.10CommonJSMar 17, 2024
1.0.0 – 1.0.5Dual (CommonJS + ESM)Jan 12, 2021

Frequently asked

Is reflect.getprototypeof ESM-only?

reflect.getprototypeof@1.0.10 is a CommonJS package. reflect.getprototypeof ships CommonJS only. require("reflect.getprototypeof") works everywhere. import "reflect.getprototypeof" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

Can I import reflect.getprototypeof with ES module syntax?

Yes. import reflectGetprototypeof from "reflect.getprototypeof" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.

Does reflect.getprototypeof work in Bun?

Yes. import "reflect.getprototypeof" loaded successfully in Bun 1.4 on Sep 9, 2026.

Does reflect.getprototypeof ship TypeScript types?

No. reflect.getprototypeof ships no type declarations and there is no @types package for it.

Links

Other commonjs packages

Similar popularity