JSPM

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

Genex module for Node.js

Package Exports

  • genex

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 (genex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

genex

genex Donate

Expands any given regular expression into all the possible strings that it would be able to match.

Install

npm i genex --save

Usage

const genex = require('genex');
const pattern = genex(/(foo|bar|baz){1,2}|snafu/);

// 13
console.log(pattern.count());

/*
[
  'foo', 'foofoo', 'foobar', 'foobaz',
  'bar', 'barfoo', 'barbar', 'barbaz',
  'baz', 'bazfoo', 'bazbar', 'bazbaz',
  'snafu'
]
*/
console.log(pattern.generate());

License

MIT