# Is type-fest ESM-only? Can you require() it?

> type-fest@5.9.0 has no importable main entry. No JavaScript entry point.

A collection of essential TypeScript types

Last verified Sep 9, 2026 against type-fest@5.9.0.

type-fest does not expose a JavaScript entry point in package.json. It is likely a CLI, a stylesheet, a type-definition package, or an asset bundle, so require() and import are not the way to use it.

## What to do

1. Do not require() or import type-fest: it has no JavaScript entry point. Use it as a CLI (npx type-fest), a stylesheet, an asset, or a type-definition package as its README describes.
2. TypeScript: types are bundled; install nothing extra.

## Facts

- Latest: 5.9.0 (Aug 30, 2026)
- Module format: No JS entry point
- Last CommonJS version: n/a
- TypeScript types: bundled
- Node engines: >=20
- Weekly downloads: 337.8M
- License: (MIT OR CC0-1.0)

## Runtime test results for type-fest@5.9.0

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

| Runtime | require("type-fest") | import "type-fest" |
|---|---|---|
| Node.js 18 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) |
| Node.js 20 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) |
| Node.js 22 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) |
| Node.js 24 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) |
| Node.js 26 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) |
| Bun 1.4.0 | fails (Error) | fails (Error) |

## How to import type-fest

ES modules:

```js
import * as typeFest from "type-fest";
```

## Module format by version

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

| Versions | Format | First published |
|---|---|---|
| 4.13.0 – 5.9.0 | No JS entry point | Mar 19, 2024 |

## Frequently asked

**Is type-fest ESM-only?**

type-fest@5.9.0 has no importable main entry. type-fest does not expose a JavaScript entry point in package.json. It is likely a CLI, a stylesheet, a type-definition package, or an asset bundle, so require() and import are not the way to use it.

**Does type-fest work in Bun?**

Importing type-fest failed in Bun 1.4.0 on Sep 9, 2026: error: Cannot find package 'type-fest' from '/Users/boat/Projects/top-seo/data/probe-work/type-fest/imp.mjs'

**Does type-fest ship TypeScript types?**

Yes. type-fest bundles its own type declarations; no @types package is needed.

## Links

- [type-fest on npm](https://www.npmjs.com/package/type-fest)
- [Source repository](https://github.com/sindresorhus/type-fest)
- [HTML version](https://canirequire.com/package/type-fest/)
- [JSON version](https://canirequire.com/package/type-fest.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.
