carol-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

carol-js

A small tool for building regular expressions.
We build a RegExp object by combining functions.
We only support ES modules.

Example

import carol from 'carol-js';

const regex = carol.seq([
  carol(/hello/),
  carol(/ /),
  carol(/world/),
  carol(/!/).many(1),
]).many().toRegex();

assert.strictEqual(regex.source, '(?:hello world(?:!)+)*');

Documents

Installation

npm i carol-js

Test

git clone https://github.com/marihachi/carol-js.git
cd carol-js
npm i
npm run build
npm test

License

MIT

Package Sidebar

Install

npm i carol-js

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

6.29 kB

Total Files

5

Last publish

Collaborators

  • marihachi