Skip to content

Getting Started

Dunna generates random values for tests, seed data, and quick prototypes. The public API is a single object with grouped helpers.

Install

Use your preferred package manager:

bash
npm install dunna
bash
pnpm add dunna
bash
yarn add dunna
bash
bun add dunna

Import

Dunna exposes a named export dunna (there is no default export).

ESM

ts
import { dunna } from 'dunna';

CommonJS

ts
const { dunna } = require('dunna');

Quick example

ts
import { dunna } from 'dunna';

dunna.basic.boolean();
dunna.basic.integer({ min: 1, max: 101 }); // integer in [1, 101)
dunna.person.name();
dunna.location.cityName();

See the API overview for all modules and the module reference for detailed options.

Documentation site

This site is built with VitePress. From the repository root:

ScriptDescription
bun run docs:devStart the dev server
bun run docs:buildStatic build to docs/.vitepress/dist
bun run docs:previewPreview the production build