Skip to content
🚫 Zero Dependencies🟦 TypeScript Ready📦 ESM & CJS Support⚡ Ultra Lightweight

Vegan Ipsum NPM Package

Build with purpose. Use the Vegan Ipsum NPM package to programmatically generate cruelty-free filler text for your your next project in seconds. Learn how to install and use it in your projects with our comprehensive guide.

Introduction

Vegan Ipsum JavaScript Library

vegan-ipsum is a lightweight, zero-dependency JavaScript library for generating unique, vegan-themed placeholder text. It serves as a cruelty-free alternative to traditional Lorem Ipsum, offering distinctive filler content for your layouts.

Designed for developers, designers, and content creators, this package allows you to integrate ethically inspired, plant-based dummy text into your projects. It is an excellent choice for building vegan blogs, sustainability platforms, or React applications promoting compassionate living.

The library is environment-agnostic and fully compatible with Node.js, modern browsers, and React Native, ensuring seamless integration across diverse JavaScript ecosystems.

Package Management

Library Installation

Install vegan-ipsum using your preferred package manager. A local installation is recommended for application development, while a global installation allows you to utilize the library as a CLI tool for quick text generation.

Local Installation

Adds vegan-ipsum to your project's dependencies.

npm
npm install vegan-ipsum
Yarn
yarn add vegan-ipsum
pnpm
pnpm add vegan-ipsum

Global Installation

Installs the package globally so you can use it from the command line anywhere on your system.

npm (global)
npm install -g vegan-ipsum

Programmatic Generation

Library Usage

After installation, you can import vegan-ipsum into your JavaScript or TypeScript project to generate plant-based placeholder text programmatically.

The package supports two usage styles:

  • Class-based API: ideal when you need structured, reusable configuration.
  • Functional API: perfect for quick, inline text generation.

Class-Based Usage:

Import the VeganIpsum class and create an instance with configuration options. This gives you fine-grained control over sentence length, paragraph structure, and output style.

Javascript - Class-Based Usage
import { VeganIpsum } from "vegan-ipsum";

const vegan = new VeganIpsum({
  sentencesPerParagraph: { min: 4, max: 8 },
  wordsPerSentence: { min: 4, max: 16 },
});

// Generate one word
console.log(vegan.generateWords(1));

// Generate five sentences
console.log(vegan.generateSentences(5));

// Generate seven paragraphs
console.log(vegan.generateParagraphs(7));

Use this approach when you need consistent formatting across multiple calls or want full control over how the text is structured.

Functional Usage:

For quick and simple use cases, call the default exported function. It generates text immediately and accepts an options object for customization.

Javascript - Functional Usage
import { VeganIpsum } from "vegan-ipsum";

// Generates one sentence by default
const sentence = VeganIpsum();

// Generates custom text with advanced options
const customText = VeganIpsum({
  count: 1,
  format: "plain",        // "plain" or "html"
  paragraphLowerBound: 3,
  paragraphUpperBound: 7,
  sentenceLowerBound: 5,
  sentenceUpperBound: 15,
  random: Math.random,
  units: "sentences",     // "words", "sentences", or "paragraphs"
});

console.log(customText);

This form is best for one-off calls, CLI usage, or situations where you don't need to maintain a reusable instance.

Resources & Documentation

For comprehensive API documentation and advanced configuration options, visit the official vegan-ipsum npm package page. If you are new to open source, we recommend reading the contribution guidelines before getting started.

Developers are encouraged to explore the GitHub repository to inspect the source code. If you encounter any bugs or have suggestions for improvements, please report an issue or request a feature. Community contributions via pull requests are also welcome.

Features

Why Choose Vegan Ipsum?

Vegan Ipsum is designed to be simple, fast, and flexible. Whether you're building web apps, Node.js services, or CLI tools, it gives you clean, customizable placeholder text without unnecessary complexity.

Zero Dependencies

Extremely lightweight and dependency-free, keeping your bundle size small and your project fast.

CommonJS & ES Module Support

Works seamlessly with both require() and import syntax, making it compatible with modern and legacy setups.

Fully Customizable Output

Control sentence length, paragraph size, formatting style, and output type to match your exact content needs.

Runs Everywhere

Compatible with Node.js, browsers, and React Native, so you can generate text in virtually any JavaScript environment.

Built-in CLI Support

Generate vegan placeholder text directly from your terminal with a simple and intuitive command-line interface.

Ethically Themed Content

Perfect for plant-based, sustainable, and ethical projects that want placeholder text aligned with their values.