typester
A simple to use WYSIWYG text editor, inspired by Medium and Medium Editor, that produces clean and predictable HTML from your user's input.
- Flexible, fast, & fabulous We've worked diligently to make sure that Typester is a robust editor that is flexible, powerful, and— above all— simple. We have designed it to do what it's meant to do, do it well, and then stay out of the way.
- No unused code here Typester has been designed to be lean, both in byte size and resource consumption. Typester has only one third party dependency, DOMPurify. Every other code requirement, from DOM traversal and manipulation to event handling, was developed bespoke for this package.
- Engineered for modern modules Typester has been created using ES6+ JavaScript module patterns, which means you need only import it and instantiate it. If you still prefer <script> imports that's fine too; Typester will bind itself to the global scope allowing you to new window.Typester({ /* options */ }).
- Minimal DOM footprint Typester won't clutter your pristine markup with multiple DOM injections for each editor instance. Need multiple editors on a single page? No problem, Typester will inject single instances of its DOM requirements which will be shared between the editors.
- Single file import (batteries included) No need to import separate stylesheets and additional dependencies. Typester comes with everything it needs rolled into one JS file.
- Pure XSS-free DOM powered by DOMPurify Typester, thanks to the awesome power of DOMPurify, will ensure that the HTML you receive is sanitized against XSS exploits.
Brought to you by: Type/Code
How to set up this bad boy
Typester can be installed via NPM or Yarn…
… and then instantiated in your code: