canirequire

canirequireCommonJS › gulp-jshint

Is gulp-jshint ESM-only? Can you require() it?

JSHint plugin for gulp

Last verified Sep 9, 2026 against gulp-jshint@2.1.0. JSON

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

gulp-jshint ships CommonJS only. require("gulp-jshint") works everywhere. import "gulp-jshint" 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
2.1.0 (Dec 29, 2017)
Module format
CommonJS
Last CommonJS version
2.1.0
TypeScript types
None
Node engines
>= 0.4.0
Weekly downloads
69K
License
MIT

Does gulp-jshint@2.1.0 actually load? Runtime test results

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

Runtimerequire("gulp-jshint")import "gulp-jshint"
Node.js 18✗ failsERR_INVALID_ARG_TYPE✗ failsERR_INVALID_ARG_TYPE
Node.js 20✗ failsERR_INVALID_ARG_TYPE✗ failsERR_INVALID_ARG_TYPE
Node.js 22✗ failsERR_INVALID_ARG_TYPE✗ failsERR_INVALID_ARG_TYPE
Node.js 24✗ failsERR_INVALID_ARG_TYPE✗ failsERR_INVALID_ARG_TYPE
Node.js 26✗ failsERR_INVALID_ARG_TYPE✗ failsERR_INVALID_ARG_TYPE
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 gulp-jshint

ES modules (import)

import gulpJshint from "gulp-jshint";

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 gulpJshint = require("gulp-jshint");

Module format by version

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

VersionsFormatFirst published
0.0.1 – 2.1.0CommonJSAug 8, 2013

Frequently asked

Is gulp-jshint ESM-only?

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

Yes. import gulpJshint from "gulp-jshint" 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 gulp-jshint work in Bun?

Yes. import "gulp-jshint" loaded successfully in Bun 1.4 on Sep 9, 2026.

Does gulp-jshint ship TypeScript types?

No. gulp-jshint ships no type declarations and there is no @types package for it.

Links

Other commonjs packages

Similar popularity