Thank you for your interest in contributing!
This project uses git submodules for vendored dependencies (RE2 and Abseil). Clone recursively:
git clone --recursive git@github.com:uhop/node-re2.git
cd node-re2
npm installSee ARCHITECTURE.md for the module map and dependency graph.
- Make your changes.
- Rebuild the addon:
npm run rebuild - Lint:
npm run lint:fix - Test:
npm test - Type-check:
npm run ts-check
- CommonJS (
require()/module.exports) in JavaScript source, ESM (import) in tests (.mjs). - C++ code uses tabs (4-wide indentation). JavaScript uses 2-space indentation.
- Formatted with Prettier — see
.prettierrcfor settings. - C++ addon API uses nan (Native Abstractions for Node.js).
- Keep
re2.jsandre2.d.tsin sync.
- Never edit files under
vendor/— they are git submodules. - RE2 always operates in Unicode mode — the
uflag is added implicitly. - Buffer support is a first-class feature — all methods must handle both strings and Buffers.
If you are an AI coding agent, see AGENTS.md for detailed project conventions, commands, and architecture.