canirequire

canirequireDual (CommonJS + ESM) › three

Is three ESM-only? Can you require() it?

JavaScript 3D library

Last verified Sep 9, 2026 against three@0.186.0. JSON

Dual (CommonJS + ESM) Dual package — both require() and import work

three publishes both a CommonJS entry and a native ESM entry (ESM added in 0.137.0). require("three") and import "three" both work on every supported Node.js version and in Bun.

Latest
0.186.0 (Sep 8, 2026)
Module format
Dual (CommonJS + ESM)
Last CommonJS version
0.186.0
Native ESM since
0.137.0
TypeScript types
@types/three
Node engines
not declared
Weekly downloads
14.0M
License
MIT

Does three@0.186.0 actually load? Runtime test results

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

Runtimerequire("three")import "three"
Node.js 18✗ failsERR_REQUIRE_ESM✓ 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

A failing require() on a CommonJS package usually means the package needs a browser/DOM global, a peer dependency, or a native binary that is not available in a bare Node.js process.

How to import three

ES modules (import)

import three from "three";

CommonJS (require)

const three = require("three");

Module format by version

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

VersionsFormatFirst published
0.144.0 – 0.186.0Dual (CommonJS + ESM)Aug 31, 2022

Frequently asked

Is three ESM-only?

three@0.186.0 ships CommonJS and ESM builds. three publishes both a CommonJS entry and a native ESM entry (ESM added in 0.137.0). require("three") and import "three" both work on every supported Node.js version and in Bun.

Can I require three?

Yes. three ships a CommonJS entry, so require("three") works on every Node.js version, alongside the native ESM entry for import.

Does three work in Bun?

Yes. import "three" loaded successfully in Bun 1.4 on Sep 9, 2026.

Does three ship TypeScript types?

Not bundled. Install the community types with "npm install -D @types/three".

Links

Other dual (commonjs + esm) packages

Similar popularity