You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

pakustadz-canvas

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pakustadz-canvas

Canvas module untuk membuat dialog box Soalan style Pak Ustadz

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

pakustadz-canvas

Canvas module untuk membuat dialog box Soalan style Pak Ustadz

Installation

npm install pakustadz-canvas

Usage

const PakustadzCanvas = require('pakustadz-canvas');
const fs = require('fs');

async function create() {
  const canvas = new PakustadzCanvas(500, 300);
  const image = await canvas.createSoalanBox("Soalan", "Hallo Pak Ustadz");
  
  const buffer = await canvas.toBuffer(image);
  fs.writeFileSync('output.png', buffer);
}

create();

API

Constructor

new PakustadzCanvas(width, height)

Methods

createSoalanBox(title, text)

Returns a Promise that resolves to an image object

  • title - Header text (default: "Soalan")
  • text - Content text (optional)

toBuffer(image)

Returns PNG buffer (async)

toBase64(image)

Returns base64 data URL (async)

Example

const PakustadzCanvas = require('pakustadz-canvas');
const fs = require('fs');

(async () => {
  const canvas = new PakustadzCanvas(500, 300);
  const image = await canvas.createSoalanBox("Soalan", "Hallo Pak Ustadz");
  
  const buffer = await canvas.toBuffer(image);
  fs.writeFileSync('soalan.png', buffer);
})();

License

MIT

Keywords

canvas

FAQs

Package last updated on 25 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts