canirequire › Dual (CommonJS + ESM) › @tailwindcss/node
Is @tailwindcss/node ESM-only? Can you require() it?
A utility-first CSS framework for rapidly building custom user interfaces.
Last verified Sep 9, 2026 against @tailwindcss/node@4.3.3. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
@tailwindcss/node publishes both a CommonJS entry and a native ESM entry (ESM added in 4.0.0). require("@tailwindcss/node") and import "@tailwindcss/node" both work on every supported Node.js version and in Bun.
Does @tailwindcss/node@4.3.3 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("@tailwindcss/node") from a CommonJS file and import "@tailwindcss/node" from an ES module.
| Runtime | require("@tailwindcss/node") | import "@tailwindcss/node" |
|---|---|---|
| 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 @tailwindcss/node
ES modules (import)
import node from "@tailwindcss/node";CommonJS (require)
const node = require("@tailwindcss/node");Module format by version
Derived from the type, main and exports fields of every stable release on npm (46 versions; the newest 46 shown).
| Versions | Format | First published |
|---|---|---|
| 4.0.0 – 4.3.3 | Dual (CommonJS + ESM) | Jan 21, 2025 |
Frequently asked
Is @tailwindcss/node ESM-only?
@tailwindcss/node@4.3.3 ships CommonJS and ESM builds. @tailwindcss/node publishes both a CommonJS entry and a native ESM entry (ESM added in 4.0.0). require("@tailwindcss/node") and import "@tailwindcss/node" both work on every supported Node.js version and in Bun.
Can I require @tailwindcss/node?
Yes. @tailwindcss/node ships a CommonJS entry, so require("@tailwindcss/node") works on every Node.js version, alongside the native ESM entry for import.
Does @tailwindcss/node work in Bun?
Yes. import "@tailwindcss/node" loaded successfully in Bun 1.4 on Sep 9, 2026.
Does @tailwindcss/node ship TypeScript types?
Yes. @tailwindcss/node 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
- end-of-stream 1.4.5CommonJS
- sharp 0.35.4Dual
- d3-interpolate 3.0.1ESM-only
- jest-diff 30.5.1Dual
- get-east-asian-width 1.6.0ESM-only
- stop-iteration-iterator 1.1.0CommonJS
- data-uri-to-buffer 8.0.0ESM-only
- d3-format 3.1.2ESM-only