@dooboostore/lib-node
v1.0.5
Published
dooboostore library for node
Readme
@dooboostore/lib-node
Full Documentation: https://dooboostore-develop.github.io/@dooboostore/lib-node
A Node.js library for generating random placeholder images.
Features
- Generate Placeholder Images: Create images of a specified size with random background colors.
- Custom Text: Add custom text to the generated images, which is automatically centered.
- Save to File: Save the generated image as a PNG file.
- Uses
canvas: Built on top of the powerfulcanvaslibrary for server-side image generation.
Installation
# pnpm
pnpm add @dooboostore/lib-node
# npm
npm install @dooboostore/lib-node
# yarn
yarn add @dooboostore/lib-nodeBasic Usage
import { RandomImage } from '@dooboostore/lib-node';
import * as path from 'path';
async function generateImage() {
const randomImage = new RandomImage();
const filePath = path.join(__dirname, 'my-random-image.png');
await randomImage.generate(200, 200, 'Hello, Node!', filePath);
console.log(`Image saved to ${filePath}`);
}
generateImage();Learn More
The detailed API documentation is available on our documentation website.
License
This package is licensed under the MIT License.
