Scan your JavaScript project's dependencies and find which ones can be replaced with modern browser/runtime built-in APIs.
Zero dependencies. This tool practices what it preaches.
npx skills add https://github.com/soderlind/browser-native --skill browser-native -gOnce installed, ask Copilot to scan your project:
"Scan my dependencies for browser-native replacements"
npm install -g @soderlind/browser-nativeOr run directly with npx:
npx @soderlind/browser-native# Scan current project
browser-native
# Scan a specific directory
browser-native ../my-app
# Output as Markdown with before/after code examples
browser-native --md
# Save markdown report to file
browser-native --md --out report.md
# Output as JSON (pipe to jq, etc.)
browser-native --json
browser-native --json | jq '.summary'
# Show help
browser-native --helpThe tool checks your dependencies and devDependencies against a database of 70+ npm packages that have native browser/runtime equivalents:
| Category | Example packages | Native replacement |
|---|---|---|
| HTTP | axios, node-fetch, request, got | fetch() |
| URL / Query | query-string, qs, url-parse | URL, URLSearchParams |
| Object Utils | lodash.clonedeep, object-assign | structuredClone(), Object.assign() |
| Array Utils | lodash.flatten, lodash.find, lodash.uniq | .flat(), .find(), [...new Set()] |
| UUID | uuid, nanoid, shortid | crypto.randomUUID() |
| Date | moment, moment-timezone | Intl.DateTimeFormat |
| Promises | bluebird, q, es6-promise | Promise |
| Strings | left-pad, repeat-string | .padStart(), .repeat() |
| Type checks | is-number, isarray, is-promise | typeof, Array.isArray() |
| Encoding | base-64, js-base64 | btoa(), atob() |
| Polyfills | abort-controller, text-encoding, globalthis | Native globals |
| Observers | intersection-observer, resize-observer-polyfill | Native APIs |
| Crypto | crypto-js (partial) | crypto.subtle |
| Streams | web-streams-polyfill | ReadableStream |
| FormData | form-data, formdata-polyfill | FormData |
Colored table with package name, category, replacement API, and confidence level.
Detailed report grouped by category, with:
- Before/after code examples
- Browser support tables (Chrome, Firefox, Safari, Edge, Node.js)
- Confidence indicators and caveats
Structured output for piping into other tools:
{
"summary": {
"scannedFiles": 1,
"totalDependencies": 42,
"replaceableCount": 8,
"fullReplacements": 5,
"partialReplacements": 3
},
"replaceable": [...]
}- Full — drop-in replacement. The native API covers the same functionality.
- Partial — covers most common use cases, but the package may have features the native API doesn't (e.g.,
qssupports nested objects,URLSearchParamsdoes not).
The tool exits with code 1 if replaceable dependencies are found, 0 if none. Use in CI to flag outdated polyfills:
- run: npx @soderlind/browser-native
continue-on-error: trueAutomatically scans packages/, apps/, libs/, and modules/ subdirectories for additional package.json files.
Node.js 18+
skills/
browser-native/
SKILL.md # Copilot skill definition
scripts/
cli.js # CLI entry point
scanner.js # Package.json scanner
replacements.js # Database of 70+ replaceable packages
formatters/
table.js # ANSI terminal table
markdown.js # Markdown report with code examples
json.js # JSON output
references/
replacements-guide.md # Detailed replacement reference
MIT