CDN Usage
How to load UtilsJS via CDN (jsDelivr & unpkg) with browser support notes.
Using via CDN
You can use UtilsJS on any browser environment through CDN delivery.
This is ideal for:
- Rapid prototyping.
- Small client-only projects.
- Loading utilities without installing NPM packages.
- Embedding UtilsJS in static HTML sites.
CDN bundles include the full library (minified & browser-ready), and expose a global namespace.
Available CDN Providers
UtilsJS is available on major CDNs with automatic cache-busting and version pinning support.
With jsDelivr
With unpkg
Global Browser Access
Once loaded, the library becomes available via:
or directly:
This allows usage without ES modules, imports, or bundlers.
Version Pinning (Recommended)
Pin a specific version to avoid unexpected updates:
Or use a semver major range:
Important Notes
When using UtilsJS via CDN, keep the following in mind:
- Load the CDN script before your own scripts, so the global namespace is ready.
- Some utilities are Node.js-only and will not work in the browser:
- Tailwind utilities.
- Next.js helpers.
- Any function requiring filesystem, process, or server context.
- The CDN bundle is ~350 KB (minified) because it contains the entire library.
- For production usage, NPM installation is strongly recommended:
- Allows tree-shaking to remove unused utilities.
- Reduces bundle size dramatically.
- Enables full TypeScript type inference.
- Supports modern module resolution (ESM).
When Should You NOT Use the CDN Version?
Avoid CDN usage for:
- Large SPA projects.
- Server-side rendering (Next.js, React Router Remix, Nuxt, etc).
- Codebases requiring strict type-safety.
- Environments with limited bandwidth.
For these cases, prefer installing via NPM instead of CDN.
See the full installation guide here: UtilsJS Installation
