Last Updated: February 25, 2016
·
2.077K
· ninjascribble

Dimsum generates lorem ipsum text for your Node.js and web projects

GitHub: https://github.com/ninjascribble/dimsum
npm: https://npmjs.org/package/dimsum

There are a ton of lorem ipsum generators out there, but for the most part you have to navigate to a site, run its tool, and copy+paste the output into your project. If you have lots of text, you're going to be doing this lots of times.

Dimsum aims to keep your projects cleaner, and make your life easier by doing two things well: It provides a simple JavaScript API that returns as much lorem ipsum as you want, and it will also dynamically replace tokens in your HTML with lorem ipsum. Usage notes are in the GitHub repository README, but basically...

// JavaScript: Returns 3 paragraphs of lorem ipsum
dimsum(3);

<!-- HTML: Replaced with 3 <p> of lorem ipsum -->
{{dimsum:p3}}

It can be configured to output either plaintext or HTML, and supports two flavors of lorem ipsum right out of the box ("latin" and "jabberwocky").