Skip to content

yyytcool/babel-plugin-rexx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦖 babel-plugin-rexx

A Babel plugin designed to optimize the usage of the Rexx library within JavaScript projects.

Rexx is a human-friendly regex library that offers structured syntax and variable support.

This plugin enables developers to write regex patterns using Rexx's more readable syntax, which is then transformed into standard JavaScript regex patterns during the build process.

Install

# Install rexx using npm
npm install --save-dev babel-plugin-rexx
# using Yarn
yarn add -D babel-plugin-rexx

Usage

To use babel-plugin-rexx, add it to your .babelrc configuration:

// .babelrc
{
  "plugins": ["babel-plugin-rexx"]
}

Example

Example of transforming Rexx syntax into standard JavaScript regex patterns.

// Using Rexx syntax for regex patterns
const regex1 = /*rexx*/" one_of { 'a', 'b', 'c' } "

const regex2 = /* rexx */ `
one_of { range {'a', 'z'} }
`
// After Babel transformation
const regex1 = {
	default: /[abc]/,
}
const regex2 = {
	default: /[a-z]/,
}

Demo

Check out a live demo of babel-plugin-rexx in action here.

Contributing

Contributions to this project are welcome.

Clone and fork:

git clone https://github.com/yyytcool/babel-plugin-rexx.git

License

Apache License.

Copyright (c) 2024-present, yyytcool

About

A Babel plugin designed to optimize the usage of the Rexx library within JavaScript projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published