generate-function is a Node module for creating generated functions at runtime, useful when you need to generate code dynamically for performance reasons. It lets you build function source text, compile it with toFunction, and safely insert values, variables, and object properties into the generated code.
Project status
- Actively maintained: No clear evidence of active maintenance today, the most recent upstream push was 2024-06-14 and the newest listed updates (v2.3.1) are from 2018-08-31, indicating a long gap and likely quiet or maintenance-mode status.
- Update cadence: After the 2018-08-31 cluster (v2.3.0 to v2.3.1), there are no newer versioned updates shown; upstream activity in 2024 suggests some repository motion, but the provided changelog data is not recent.
AI summary generated
Recent updates
v2.3.1
v2.3.1 makes generated identifiers safer by adding reserved JavaScript keyword handling. It also expands documentation around generated variables and object property generation, and adds tests covering `gen.property` and `gen.sym` behavior.
v2.3.0
Release v2.3.0 contains minimal code changes. The only substantive modification in the diff is adding a new helper method on the generated line builder, plus updating the package version field.
Featuresv2.2.1
Release v2.2.1 was published on 2018-08-31, but no release notes were provided. Without published notes or described changes, there is no documented information on new features, bug fixes, breaking changes, security or dependency updates.
v2.2.0
v2.2.0 introduces changes in index.js related to how generated functions capture and merge scope variables. The release notes provide no documented changes, so behavior differences must be inferred from the code diff.
v2.1.0
Release v2.1.0 adds new helper APIs for generating formatted code, including a `formats` object and a `sym` helper for creating unique identifiers. It also changes how the generator handles strings containing newlines, by splitting them and trimming each line before applying indentation logic. No release notes were provided, so the behavioral changes in the implementation are effectively undocumented.
Featuresv2.0.0
Release v2.0.0 updates the generate-function module internals. The published release notes are missing (none provided), so the actual behavior changes in the code are not documented.
Breakingv1.1.0
Release notes for v1.1.0 are not provided. The code diff shows a small update to generate-function’s main module (index.js) that adds new whitespace and else-block handling logic via a `.trim()` method on the generated line object, plus a package version bump to 1.1.0.
Featuresv1.0.3
v1.0.3 contains a small internal change to how indentation is computed in the code generator. Release notes were not provided, so the only actionable information comes from the code diff itself.
v1.0.2
Release v1.0.2 updates the package version and makes a small change to the exported function behavior in index.js. No release notes were provided, so the only observable changes come from the code diff.
v1.0.1
Release v1.0.1 was published on 2014-07-30, but no release notes were provided by the publisher. As a result, this release cannot be analyzed for specific API changes, bug fixes, or other developer-impacting modifications from the provided information.