Skip to content
JS
Package

optional-require

NodeJS Require that let you handle module not found error without try/catch

v2.1.1, 30 Aug 2026Apache-2.0ESM + CommonJSTypes: BundledNode.js utilities
$ npm install optional-require

Key numbers

As of 25 Sept 2026
Weekly downloads
624.6k
-1% over 12 months
Gzip bundle size
-
No Bundlephobia data
Dependencies
0
Direct, from package.json
Last release
25 days ago
v2.1.1
GitHub stars
9
5 forks
Open issues / PRs
3 / 0
Contributors
-
Commits, last 52 weeks
4

Downloads

Last week 2026-09-15 to 2026-09-21
0500k1m1.5mSept 2025Mar 2026Sept 2026High 1.2m (19 May 2026)Low 425.3k (23 Dec 2025)
Weekly npm downloads, one point per week, weeks starting 23 Sept 2025 to 15 Sept 2026. The y axis starts at zero.

624,602 downloads last week. The 12-month change of -1% compares the average of the last 4 weeks with the first 4 weeks of the series.

Releases, last 12 months
126 in total
Latest version
2.1.1, 30 Aug 202625 days ago
First published
4 Feb 2017
Last push to GitHub
30 Aug 202625 days before the snapshot
Repository archived
No
Open issues
3
Open pull requests
0
Commits, last 52 weeks
4
Dependents on npm
-

Major versions

  1. v2 first release 2.0.0, 31 May 2025
  2. v1 first release 1.0.0, 4 Feb 2017
  3. v0 first release 0.1.0, 4 Feb 2017

Recent releases

VersionPublished
2.1.130 Aug 2026
2.1.06 Jul 2025
2.0.41 Jul 2025
1.1.101 Jul 2025
2.0.31 Jul 2025
1.1.91 Jul 2025
2.0.21 Jul 2025
2.0.13 Jun 2025
2.0.031 May 2025
1.1.822 Sept 2021
1.1.712 Aug 2021
1.1.67 Aug 2021
1.1.57 Aug 2021
1.1.45 Aug 2021
Module format
ESM + CommonJSFrom package.json type, main and exports fields
TypeScript types
Bundled
Node.js engine range
>=20
Runtimes
-
Unpacked size (npm)
66 kB
Dependencies (0)
None
npm install optional-require
  • jsDelivrhttps://cdn.jsdelivr.net/npm/optional-require@2.1.1/
  • unpkghttps://unpkg.com/optional-require@2.1.1/
  • esm.shhttps://esm.sh/optional-require@2.1.1
Sources: npm registry, npm downloads API, GitHub API. Data fetched 25 Sept 2026.

Indexability: Indexed.