canirequire

canirequireESM-only › @humanfs/core

Is @humanfs/core ESM-only? Can you require() it?

The core of the humanfs library.

Last verified Sep 9, 2026 against @humanfs/core@0.19.2. JSON

ESM-only ESM-only — it has never shipped a CommonJS build

@humanfs/core has been ESM-only since its first stable release. There is no version you can require() on Node.js 18 or older.

require("@humanfs/core") failed in our probe on Node.js 20+ as well. See the runtime matrix below for the exact error.

Latest
0.19.2 (Apr 17, 2026)
Module format
ESM-only
Last CommonJS version
none
ESM-only since
0.6.0 (Jan 30, 2024)
TypeScript types
Bundled
Node engines
>=18.18.0
License
Apache-2.0

Does @humanfs/core@0.19.2 actually load? Runtime test results

Installed and executed on Sep 9, 2026 with require("@humanfs/core") from a CommonJS file and import "@humanfs/core" from an ES module.

Runtimerequire("@humanfs/core")import "@humanfs/core"
Node.js 18✗ failsERR_PACKAGE_PATH_NOT_EXPORTED✓ works
Node.js 20✗ failsERR_PACKAGE_PATH_NOT_EXPORTED✓ works
Node.js 22✗ failsERR_PACKAGE_PATH_NOT_EXPORTED✓ works
Node.js 24✗ failsERR_PACKAGE_PATH_NOT_EXPORTED✓ works
Node.js 26✗ failsERR_PACKAGE_PATH_NOT_EXPORTED✓ works
Bun 1.4✗ failserror: Cannot find module '@humanfs/core' from '/Users/boat/Projects/top-seo/data/probe-work/@humanfs__core/req.cjs'✓ works

How to import @humanfs/core

ES modules (import)

import core from "@humanfs/core";

CommonJS (require)

// Node.js 20.19+ / 22.12+ / newer (package has no top-level await):
const core = require("@humanfs/core");

// Any Node.js version:
const core = await import("@humanfs/core");

Module format by version

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

VersionsFormatFirst published
0.6.0 – 0.19.2ESM-onlyJan 30, 2024

Frequently asked

Is @humanfs/core ESM-only?

@humanfs/core@0.19.2 is ESM-only. @humanfs/core has been ESM-only since its first stable release. There is no version you can require() on Node.js 18 or older.

Which version of @humanfs/core still supports CommonJS / require()?

None. @humanfs/core has always been ESM-only. Use import, or await import("@humanfs/core") from CommonJS.

How do I use @humanfs/core from a CommonJS file?

Use a dynamic import: const mod = await import("@humanfs/core"). On Node.js 20.19+, 22.12+ and newer, a plain require("@humanfs/core") also works for ESM packages that do not use top-level await.

Does @humanfs/core work in Bun?

Yes. import "@humanfs/core" loaded successfully in Bun 1.4 on Sep 9, 2026.

Does @humanfs/core ship TypeScript types?

Yes. @humanfs/core bundles its own type declarations; no @types package is needed.

Links

Other esm-only packages

Similar popularity