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

> file-entry-cache@11.1.5 ships CommonJS and ESM builds. Dual package — require() works on every Node.js version we test; import works too.

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.

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.

## Facts

- 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

## Runtime test results for file-entry-cache@11.1.5

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.0 | works | works |

## How to import file-entry-cache

ES modules:

```js
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:

```js
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") 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

- [file-entry-cache on npm](https://www.npmjs.com/package/file-entry-cache)
- [Source repository](https://github.com/jaredwray/cacheable)
- [HTML version](https://canirequire.com/package/file-entry-cache/)
- [JSON version](https://canirequire.com/package/file-entry-cache.json)

---

For scripts and AI agents: any package is at https://canirequire.com/package/<name>/index.md (Markdown) or https://canirequire.com/package/<name>.json (JSON); the site index is https://canirequire.com/llms.txt. Fetch the URL directly; no search needed.
