org-regex
Regular expression for matching npm organization names
Last updated 5 years ago by sidoshi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install org-regex 
SYNC missed versions from official npm registry.

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.

Related

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

License

MIT © Siddharth Doshi

Current Tags

  • 1.0.0                                ...           latest (5 years ago)

1 Versions

  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |