canirequire

canirequireCommonJS › vuepress

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

Minimalistic doc generator with Vue component based layout system

Latest version 1.9.10, published Aug 14, 2023. JSON

CommonJS CommonJS — require() works on every Node.js version

vuepress ships CommonJS only. require("vuepress") works everywhere. import "vuepress" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

Latest
1.9.10 (Aug 14, 2023)
Module format
CommonJS
Last CommonJS version
1.9.10
TypeScript types
None
Node engines
>=8.6
Weekly downloads
64K
License
MIT

Does vuepress@1.9.10 actually load? Runtime test results

Runtime probe pending for this version. The values below are what package.json declares; they are refreshed once the probe runs.

Runtimerequire("vuepress")import "vuepress"
Node.js 18✓ expected✓ expected
Node.js 20✓ expected✓ expected
Node.js 22✓ expected✓ expected
Node.js 24✓ expected✓ expected
Node.js 26✓ expected✓ expected
Bun 1.4pendingpending

Install failed in our sandbox: PROBE_TIMEOUT The rows above show what package.json declares.

How to import vuepress

ES modules (import)

import vuepress from "vuepress";

Named imports from a CommonJS package only work when Node.js can statically detect them. If a named import fails, use the default import and destructure.

CommonJS (require)

const vuepress = require("vuepress");

Module format by version

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

VersionsFormatFirst published
0.8.0 – 1.9.10CommonJSApr 23, 2018

Frequently asked

Is vuepress ESM-only?

vuepress@1.9.10 is a CommonJS package. vuepress ships CommonJS only. require("vuepress") works everywhere. import "vuepress" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

Can I import vuepress with ES module syntax?

Yes. import vuepress from "vuepress" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.

Does vuepress ship TypeScript types?

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

Links

Other commonjs packages

Similar popularity