textr is a tiny and extendable framework designed for composing text transformation functions. Its core idea revolves around enabling developers to build modular typography tools by chaining small, single-responsibility text processing modules. The package encourages creating specific transformers for tasks like smart quotes, ellipses, or em-dashes, rather than a monolithic typographic engine. The current stable version is 0.3.0, released in 2015. Given its age and lack of updates, it's considered an abandoned project, meaning no new features or maintenance fixes are expected. Its key differentiator was its pluggable architecture for highly customized text processing workflows, allowing users to combine various `typographic-*` packages available on npm.
npm install textrVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize `textr` with options, register multiple typographic plugins, and process a string through the transformation pipeline.
For new projects, evaluate actively maintained typographic or text-processing libraries. If `textr` is essential, thorough testing in your target environment and auditing dependencies is recommended.
Update calls to `tf.exec(text)` to `tf.exec(text, currentOptions)` where `currentOptions` is an object of relevant options. Plugins should also expect `options` as the second argument.
Use `const textr = require('textr');`. For ESM-only projects, you might need to use dynamic `import()` or rely on bundler configurations to handle CommonJS modules. Consider using a CommonJS wrapper if consistent ESM syntax is critical.The `textr` package exports a function directly. Use `const textr = require('textr');` and then call `textr()` to create an instance, e.g., `const tf = textr();`.First create a transformer instance using `const tf = textr();`, then call `tf.use(plugin);`.
No dependency data recorded yet.