Keeping everything in memory enables fast, large-scale writes. See the How it
Works guide to learn more.
- Codebase.commit() - Commit changes to disk
- Codebase.reset() - Reset the
codebase
and filesystem to its initial state
Committing Changes
When you make changes to your codebase through Codegen’s APIs, they aren’t immediately written to disk. You need to explicitly commit them with codebase.commit():Resetting State
The codebase.reset() method allows you to revert the codebase to its initial state:reset()
reverts both the in-memory state and any uncommitted filesystem
changes. However, it preserves your codemod implementation in .codegen/
.