This regex can be used on a JavaScript/TypeScript file to find imports from third-party packages. This is useful for determining what to put in dependencies
/peerDependencies
. This is a Rust regex, which makes it easy to use with rg
(ripgrep). Pro tip: combine rg
with sort -u
to get a list of all packages for your JS/TS project!
Based on a similar PCE2 regex