Socket
Socket
Sign inDemoInstall

scoped-regex

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    scoped-regex

Regular expression for matching scoped npm package names


Version published
Weekly downloads
852K
decreased by-0.24%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

scoped-regex Build Status

Regular expression for matching scoped npm package names

Install

$ npm install --save scoped-regex

Usage

const scopedRegex = require('scoped-regex');

scopedRegex({exact: true}).test('@sindresorhus/df');
//=> true

'foo @sindresorhus/df bar'.match(scopedRegex());
//=> ['@sindresorhus/df']

API

scopedRegex([options])

Returns a RegExp for matching scoped package names.

options.exact

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.

  • is-scoped - Check if a string is a scoped npm package name

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 22 Mar 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc