Question
How is the function exported? Is it a default export or a named one?
About sindresorhus/escape-string-regexp · 2 messages · last activity 6/15/2026
How is the function exported? Is it a default export or a named one?
The function is exported as a default export.
You can see this in both the TypeScript definition and the JavaScript implementation:
export default function escapeStringRegexp(string: string): string;export default function escapeStringRegexp(string) {This is also confirmed in [package.json:L7], which specifies "exports": "./index.js", and the usage example in [readme.md:L16] demonstrates importing it as a default export: import escapeStringRegexp from 'escape-string-regexp';
FOLLOW_UPS:
Want to ask your own question?
Open chat for sindresorhus/escape-string-regexp →Public Q&A. Generated by RepoPilot from the actual source of sindresorhus/escape-string-regexp. AI answers can be incomplete or stale — verify before relying on them.