Dimsum
Dimsum generates lorem ipsum text. You can use it in your Node.js and web projects.
Installation
With npm, just run:
npm install dimsum@0.1
Or grab the source from GitHub, and pull it into your own project.
Dimsum in two lines
var dimsum = ;; // => 'Impedit ex veniam doloribus possimus quod laudantium...'
You can configure Dimsum to return HTML, too:
dimsum;; // => '<p>Reiciendis fugit fuga ut placeat officiis nostrud...'
You can tell Dimsum exactly how much text you want:
;
In-browser replacement
Dimsum can also inject lorem ipsum into your static HTML! Just include the library and add tokens to your HTML:
{{dimsum}}
Dimsum will replace the token with one paragraph of HTML-formatted lorem ipsum. If you want more, just ask:
{{dimsum:p3}}
Flavors
Dimsum contains classic "latin" and "jabberwocky" flavors. Switching between them is easy:
dimsum; // => 'Frabjous snicker-snack to son brillig, took vorpal...'
You can even add your own flavors. Larger blocks of text work best:
dimsum; dimsum; // => Science clarifies every to realistic for news...
API
JavaScript:
// One unformatted paragraph of lorem ipsum; // Three unformatted paragraphs of lorem ipsum; // Three HTML-formatted paragraphs of lorem ipsum; // Two unformatted sentences of lorem ipsumdimsum; // Always use HTMLdimsum; // Always use Jabberwockydimsum; // Get a list of available flavorsdimsum; // Add a new flavordimsum;
HTML:
<!-- Replace with one paragraph of lorem ipsum -->{{dimsum}} <!-- Replace with three paragraphs of lorem ipsum -->{{dimsum:p3}} <!-- Replace with four sentences of lorem ipsum -->{{dimsum:s4}}
Misc
Dimsum is licensed under the MIT License. Feel free to use it however you like.
Issues or feature requests? https://github.com/ninjascribble/dimsum/issues