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. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
file-entry-cache publishes both a CommonJS entry and a native ESM entry (ESM added in 10.0.0). require("file-entry-cache") and import "file-entry-cache" both work on every supported Node.js version and in Bun.
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.
| Runtime | require("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 | ✓ works | ✓ works |
How to import file-entry-cache
ES modules (import)
import fileEntryCache from "file-entry-cache";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 (39 versions; the newest 39 shown).
| Versions | Format | First published |
|---|---|---|
| 10.0.0 – 11.1.5 | Dual (CommonJS + ESM) | Oct 4, 2024 |
| 1.0.0 – 9.1.0 | CommonJS | Mar 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") and import "file-entry-cache" both work on every supported Node.js version and in Bun.
Can I require file-entry-cache?
Yes. file-entry-cache ships a CommonJS entry, so require("file-entry-cache") works on every Node.js version, alongside the native ESM entry for import.
Does file-entry-cache work in Bun?
Yes. import "file-entry-cache" loaded successfully in Bun 1.4 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
- minimatch 10.2.6Dual
- brace-expansion 5.0.9Dual
- lru-cache 11.5.2Dual
- glob 13.0.6Dual
- eslint-visitor-keys 5.0.1Dual
- yallist 5.0.0Dual
- balanced-match 4.0.4Dual
- js-yaml 5.4.1Dual
Similar popularity
- mime 4.1.0ESM-only
- flatted 3.4.4ESM-only
- call-bound 1.0.4CommonJS
- fast-glob 3.3.3CommonJS
- uri-js 4.4.1CommonJS
- encodeurl 2.0.0CommonJS
- import-fresh 4.0.0ESM-only
- has-symbols 1.1.0CommonJS