vlad 6f123ff03e 18.07 | 6 lat temu | |
---|---|---|
.. | ||
index.js | 6 lat temu | |
license | 6 lat temu | |
package.json | 6 lat temu | |
readme.md | 6 lat temu |
Regular expression for matching scoped npm package names
$ npm install --save scoped-regex
const scopedRegex = require('scoped-regex');
scopedRegex({exact: true}).test('@sindresorhus/df');
//=> true
'foo @sindresorhus/df bar'.match(scopedRegex());
//=> ['@sindresorhus/df']
Returns a RegExp
for matching scoped package names.
Type: boolean
Default: false
(Matches any scoped package names in a string)
Only match an exact string. Useful with RegExp#test()
to check if a string is a scoped package name.
MIT © Sindre Sorhus