canirequire

canirequireESM-only › standard

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

JavaScript Standard Style

Last verified Sep 9, 2026 against standard@17.1.2. JSON

ESM-only ESM-only since 17.0.0 — last CommonJS version is 16.0.4

standard dropped its CommonJS build in 17.0.0 (April 2022). The last version you can require() on every Node.js version, including 18 and older, is 16.0.4, published Oct 3, 2021.

On Node.js 20.19+, 22.12+ and every newer release, require("standard") works anyway: Node can load synchronous ES modules through require(). Verified on Node 20, 22, 24, 26. Node.js 18 and older still fail with ERR_REQUIRE_ESM.

Latest
17.1.2 (Sep 13, 2024)
Module format
ESM-only
Last CommonJS version
16.0.4
ESM-only since
17.0.0 (Apr 20, 2022)
TypeScript types
None
Node engines
^12.22.0 || ^14.17.0 || >=16.0.0
Weekly downloads
454K
License
MIT

Does standard@17.1.2 actually load? Runtime test results

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

Runtimerequire("standard")import "standard"
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

How to import standard

ES modules (import)

import standard from "standard";

CommonJS (require)

// Node.js 20.19+ / 22.12+ / newer (package has no top-level await):
const standard = require("standard");

// Any Node.js version:
const standard = await import("standard");

// Or pin the last CommonJS release:
// npm install standard@16.0.4

Module format by version

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

VersionsFormatFirst published
17.0.0 – 17.1.2ESM-onlyApr 20, 2022
5.3.1 – 16.0.4CommonJSSep 18, 2015

Frequently asked

Is standard ESM-only?

standard@17.1.2 is ESM-only. standard dropped its CommonJS build in 17.0.0 (April 2022). The last version you can require() on every Node.js version, including 18 and older, is 16.0.4, published Oct 3, 2021.

Which version of standard still supports CommonJS / require()?

16.0.4 is the last version of standard with a CommonJS build. Install it with "npm install standard@16.0.4". Every version from 17.0.0 on is ESM-only.

How do I use standard from a CommonJS file?

Use a dynamic import: const mod = await import("standard"). On Node.js 20.19+, 22.12+ and newer, a plain require("standard") also works for ESM packages that do not use top-level await. Alternatively pin standard@16.0.4.

Does standard work in Bun?

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

Does standard ship TypeScript types?

No. standard ships no type declarations and there is no @types package for it.

Links

Other esm-only packages

Similar popularity