`codemaker` is a concise utility designed for programmatic generation of source code. It facilitates the structured creation of text files by supporting features such as automatically indented code blocks, management of multiple output files across subdirectories, and the ability to selectively exclude files from the final output. The package is currently at version 1.128.0 and exhibits an active development and release cadence, primarily delivering bug fixes and minor feature enhancements as part of the larger `jsii` ecosystem. Its core differentiators include a fluent API for building hierarchical code structures and highly customizable block and indentation formatting. Additionally, it bundles widely used string casing utilities like `toCamelCase`, `toPascalCase`, and `toSnakeCase`, providing a complete toolkit for robust and predictable code generation tasks.
npm install codemakerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize `CodeMaker`, open and write to multiple files (including nested directories), use customizable block formatting, control indentation, and exclude files before saving the generated code to a specified output path.
Always test generated output with custom formatters. Consider using the built-in `openBlock()` and `closeBlock()` for standard brace-based blocks before customizing.
Ensure that every call to `maker.openFile(fileName)` is paired with a corresponding `maker.closeFile(fileName)` when you are done writing to that file. The `closeFile` argument is optional but recommended for clarity.
Structure your code generation logic such that all calls to `maker.exclude()` are made before the final `await maker.save()` call.
Ensure you have correctly initialized `CodeMaker` with `const maker = new CodeMaker();` before using its methods.
Review your indentation settings and custom formatter functions. Use `maker.indentation = 2` (or your preferred value) for basic spacing. Debug custom formatters by logging their input/output.
Ensure the target directory for `maker.save()` is prepared. If using `fs.mkdir` directly, add `{ recursive: true }`. `CodeMaker.save` itself should handle overwriting files by default, but directory conflicts can arise if not careful.No dependency data recorded yet.