canirequire

canirequireCommonJS › hosted-git-info

Is hosted-git-info ESM-only? Can you require() it?

Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab

Last verified Sep 9, 2026 against hosted-git-info@10.1.1. JSON

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

hosted-git-info ships CommonJS only. require("hosted-git-info") works everywhere. import "hosted-git-info" 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
10.1.1 (May 18, 2026)
Module format
CommonJS
Last CommonJS version
10.1.1
TypeScript types
@types/hosted-git-info
Node engines
^22.22.2 || ^24.15.0 || >=26.0.0
Weekly downloads
90.6M
License
ISC

Does hosted-git-info@10.1.1 actually load? Runtime test results

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

Runtimerequire("hosted-git-info")import "hosted-git-info"
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 hosted-git-info

ES modules (import)

import hostedGitInfo from "hosted-git-info";

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 hostedGitInfo = require("hosted-git-info");

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
2.1.3 – 10.1.1CommonJSMay 21, 2015

Frequently asked

Is hosted-git-info ESM-only?

hosted-git-info@10.1.1 is a CommonJS package. hosted-git-info ships CommonJS only. require("hosted-git-info") works everywhere. import "hosted-git-info" 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 hosted-git-info with ES module syntax?

Yes. import hostedGitInfo from "hosted-git-info" 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 hosted-git-info work in Bun?

Yes. import "hosted-git-info" loaded successfully in Bun 1.4 on Sep 9, 2026.

Does hosted-git-info ship TypeScript types?

Not bundled. Install the community types with "npm install -D @types/hosted-git-info".

Links

Other commonjs packages

Similar popularity