JSTransformer is a utility package designed to standardize the APIs of various "jstransformer-*" packages, which encompass template engines, Markdown parsers, and code compilers. Its core purpose is to provide a consistent interface for methods such as `.render`, `.renderAsync`, `.renderFile`, and `.renderFileAsync`, along with properties like `inputFormats` and `outputFormat`. The current and only stable version is 1.0.0, which was last published over 7 years ago (June 2016). The project appears to be unmaintained, with no recent releases or active development within the `jstransformers` GitHub organization. While it aimed to unify over 100 transformers at its peak, its long-term inactivity means it likely lacks support for modern JavaScript features or recent versions of underlying transformer libraries. Its key differentiator was its API normalization, enabling interchangeability of transformers, but this benefit is significantly diminished by its abandoned status.
npm install jstransformerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize `jstransformer` with a specific transformer (like `jstransformer-marked`) and use both its synchronous `.render` and asynchronous `.renderAsync` methods to process input strings.
Consider migrating to actively maintained libraries or ensuring a thorough security review of all transitive dependencies if using in production.
Ensure your project is configured for CommonJS, or use dynamic `import()` if necessary within an ESM environment, though direct `import` syntax will fail.
Consult the documentation for the specific `jstransformer-*` plugin you are using to understand its capabilities and supported methods before calling them via the normalized API.
Run `npm install jstransformer-marked` (or the specific transformer you intend to use).
Verify that the module you are passing to `transformer()` is a properly structured `jstransformer-*` plugin and supports the `render` method. Check the plugin's documentation.
Change `import ... from 'jstransformer'` to `const ... = require('jstransformer');` and ensure your project environment supports CommonJS modules.