hsl-regex

1.0.0last stable release 10 years ago
Complexity Score
Low
Open Issues
N/A
Dependent Projects
59
Weekly Downloadsglobal
2,107,182

License

  • MIT
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

Readme

hsl-regex

Regex for matching HSL colors.

Installation

npm install --save hsl-regex

Usage

var hslRegex = require('hsl-regex');

hslRegex({ exact: true }).test('hsl(123, 45%, 67%)');  // => true
hslRegex({ exact: true }).test('foo bar');  // => false

hslRegex({ exact: true }).exec('hsl(1, 1.111%, 1.1111%)');
// => [
//  'hsl(1, 1.111%, 1.1111%)',
//  '1',
//  '1.111%',
//  '1.1111%',
//  index: 0,
//  input: 'hsl(1, 1.111%, 1.1111%)'
// ]

'hsl(123, 45%, 67%) cats and dogs'.match(hslRegex());
// = ['hsl(123, 45%, 67%)']

License

MIT

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Crafted with <3 by John Otander (@4lpine).

This package was initially generated with yeoman and the p generator.

Dependencies

No runtime dependency information found for this package.

CVE IssuesActive
0
Scorecards Score
3.00
Test Coverage
No Data
Follows Semver
Yes
Github Stars
10
Dependenciestotal
1
DependenciesOutdated
0
DependenciesDeprecated
0
Threat Modelling
No
Repo Audits
No

Learn how to distribute hsl-regex in your own private NPM registry

npm config set registry  https://npm.cloudsmith.com/owner/repo
Processing...
Done
npm install hsl-regex
Processing...
Done

2 Releases

NPM on Cloudsmith

Getting started with NPM on Cloudsmith is fast and easy.