canirequire

canirequireCommonJS › lodash.get

Is lodash.get ESM-only? Can you require() it?

The lodash method `_.get` exported as a module.

Last verified Sep 9, 2026 against lodash.get@4.4.2. JSON

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

lodash.get ships CommonJS only. require("lodash.get") works everywhere. import "lodash.get" 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
4.4.2 (Aug 13, 2016)
Module format
CommonJS
Last CommonJS version
4.4.2
TypeScript types
@types/lodash.get
Node engines
not declared
Weekly downloads
16.2M
License
MIT

Deprecated: This package is deprecated. Use the optional chaining (?.) operator instead.

Does lodash.get@4.4.2 actually load? Runtime test results

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

Runtimerequire("lodash.get")import "lodash.get"
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 lodash.get

ES modules (import)

import lodashGet from "lodash.get";

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 lodashGet = require("lodash.get");

Module format by version

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

VersionsFormatFirst published
3.7.0 – 4.4.2CommonJSApr 16, 2015

Frequently asked

Is lodash.get ESM-only?

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

Yes. import lodashGet from "lodash.get" 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 lodash.get work in Bun?

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

Does lodash.get ship TypeScript types?

Not bundled. Install the community types with "npm install -D @types/lodash.get".

Links

Other commonjs packages

Similar popularity