Skip to main content

latest

The package will generate natural language placeholder text.

This package works with BunIt is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Browsers
JSR Score
94%
Published
a month ago (0.1.1)

Lorem AI 🤖

A lightweight package that provides a Generative AI approach to lorem ipsum. The package will generate natural language placeholder text.

⚠️Note

For now, you MUST use the Google Gemini API key. 👉🏽 Get it from this page of Google Docs.

Usage:

# Bun (use any of bunx, npx, yarn dlx, or pnpm dlx)
bunx jsr add @deejaydev/lorem-ai

# Deno
deno add @deejaydev/lorem-ai

After adding the package in your project, you can import and use it in ES modules:

...
import { generateSentence } from '@deejaydev/lorem-ai'


// top level await
await generateSentence('ADD_YOUR_API_KEY_HERE', 7)
...

Heres a Full example you in a ts project

import { generateSentence } from '@deejaydev/lorem-ai'

const API_KEY = process.env.GEMINI_API_KEY

async function run() {
  try {
    const sentence = await generateSentence(API_KEY as string, 50)
    console.log(sentence)
  } catch (error) {
    console.error('Error generating sentence:', error)
  }
}

run()

Add Package

deno add @deejaydev/lorem-ai

Import symbol

import * as mod from "@deejaydev/lorem-ai";

Add Package

npx jsr add @deejaydev/lorem-ai

Import symbol

import * as mod from "@deejaydev/lorem-ai";

Add Package

yarn dlx jsr add @deejaydev/lorem-ai

Import symbol

import * as mod from "@deejaydev/lorem-ai";

Add Package

pnpm dlx jsr add @deejaydev/lorem-ai

Import symbol

import * as mod from "@deejaydev/lorem-ai";

Add Package

bunx jsr add @deejaydev/lorem-ai

Import symbol

import * as mod from "@deejaydev/lorem-ai";