How is the function exported? Is it a default export or a named one?
How is the function exported? Is it a default export or a named one?
About sindresorhus/escape-string-regexp · 2 messages · last activity 6/8/2026
Based on the README usage example, the function is exported as a default export:
import escapeStringRegexp from 'escape-string-regexp';
The import statement uses default import syntax (without curly braces), which indicates that escapeStringRegexp is the default export from the module.
However, I don't have the actual source code files indexed to show you the exact export statement. The repository description mentions it's written in JavaScript and TypeScript, so the actual export would be in one of those files (likely index.js or index.ts). To see the precise export syntax used in the source code, you'd need to check the main entry point file directly in the repository.
FOLLOW_UPS:
- What characters does this function escape?
- Can you show an example with special regex characters?
- Does it work with Unicode characters like emojis?
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.