JSPM

org-regex

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 170237
  • Score
    100M100P100Q161504F
  • License MIT

Regular expression for matching npm organization names

Package Exports

  • org-regex

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (org-regex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

org-regex Build Status

Regular expression for matching npm organizations

Install

$ npm install org-regex

Usage

const orgRegex = require('org-regex');

orgRegex({exact: true}).test('@ava');
//=> true

'foo @ava bar @ava/init'.match(orgRegex());
//=> ['@ava']

API

orgRegex([options])

Returns a RegExp for matching npm organization names.

options

Type: Object

exact

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

License

MIT © Siddharth Doshi