Skip to content

lib-package/byteminds-util

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ByteMinds PH Utility Packages

Utility packages used in the development of ByteMinds PH web platform.

Installation

Use with npm:

npx jsr add @jhenbert/byteminds-util

Use with deno:

deno add @jhenbert/byteminds-util

Use with pnpm:

pnpm dlx jsr add @jhenbert/byteminds-util

Use with yarn:

yarn dlx jsr add @jhenbert/byteminds-util

Usage

import * as mod from "@jhenbert/byteminds-util";

Example

const sendEmail = async () => {
  const from = "sender@example.com";
  const to = "recipient@example.com";
  const subject = "Hello!";
  const body = "<p>This is a test email.</p>";

  const message = mod.composeMessage(from, to, subject, body);

  const host = "smtp.example.com";
  const port = 587;
  const secure = false;
  const service = "gmail";
  const email = "user@example.com";
  const password = "user_app_password";

  const transporter = mod.mailTransporter(
    host,
    port,
    secure,
    service,
    email,
    password
  );

  try {
    await transporter.sendMail(message);
  } catch (error) {
    console.error("Sending email failed", (error as Error).message);
  }
};

About

A collection of useful utilities for ByteMinds PH.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages