Regular expression for matching npm organizations
$ npm install org-regex
const orgRegex = require('org-regex');
orgRegex({exact: true}).test('@ava');
//=> true
'foo @ava bar @ava/init'.match(orgRegex());
//=> ['@ava']
Returns a RegExp
for matching npm organization names.
Type: Object
Type: boolean
Default: false
(Matches any organization package names in a string)
Only match an exact string. Useful with RegExp#test()
to check if a string is a scoped package name.
- scoped-regex - Check if a string is a scoped npm package name
MIT © Siddharth Doshi