canirequire

canirequire › Dual (CommonJS + ESM) › file-entry-cache

Is file-entry-cache ESM-only? Can you require() it?

A lightweight cache for file metadata, ideal for processes that work on a specific set of files and only need to reprocess files that have changed since the last run

Last verified Sep 9, 2026 against file-entry-cache@11.1.5. Markdown · JSON

Dual (CommonJS + ESM) Dual package — require() works on every Node.js version we test; import works too

file-entry-cache publishes both a CommonJS entry and a native ESM entry (ESM added in 10.0.0). require("file-entry-cache") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import "file-entry-cache" works alongside it.

What to do

  1. Nothing to change. require("file-entry-cache") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import * as fileEntryCache from "file-entry-cache" works alongside it; use named imports for what the ESM entry exports.
  2. TypeScript: types are bundled; install nothing extra.
Latest
11.1.5 (Jun 27, 2026)
Module format
Dual (CommonJS + ESM)
Last CommonJS version
11.1.5
Native ESM since
10.0.0
TypeScript types
Bundled
Node engines
not declared
Weekly downloads
134.5M
License
MIT

Does file-entry-cache@11.1.5 actually load? Runtime test results

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

Runtimerequire("file-entry-cache")import "file-entry-cache"
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.0✓ works✓ works

How to import file-entry-cache

ES modules (import)

import * as fileEntryCache from "file-entry-cache";

Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.

CommonJS (require)

const fileEntryCache = require("file-entry-cache");

Module format by version

Derived from the type, main and exports fields of every stable release on npm, corrected where a runtime test of that version contradicted them (39 versions; the newest 39 shown).

VersionsFormatFirst published
10.0.0 – 11.1.5Dual (CommonJS + ESM)Oct 4, 2024
1.0.0 – 9.1.0CommonJSMar 2, 2015

Frequently asked

Is file-entry-cache ESM-only?

file-entry-cache@11.1.5 ships CommonJS and ESM builds. file-entry-cache publishes both a CommonJS entry and a native ESM entry (ESM added in 10.0.0). require("file-entry-cache") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import "file-entry-cache" works alongside it.

Can I require file-entry-cache?

Yes. file-entry-cache ships a CommonJS entry alongside the native ESM entry. require("file-entry-cache") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun.

Does file-entry-cache work in Bun?

Yes. import "file-entry-cache" loaded successfully in Bun 1.4.0 on Sep 9, 2026.

Does file-entry-cache ship TypeScript types?

Yes. file-entry-cache bundles its own type declarations; no @types package is needed.

Links

Other dual (commonjs + esm) packages

Similar popularity