npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@janooma/jms-core

v0.1.0

Published

Provider-based messaging core for Email and SMS with pluggable integrations

Downloads

22

Readme

@janooma/jms-core

Provider-driven messaging module for Email and SMS.

| Channel | Provider | |---------|----------| | Email | ZeptoMail (Zoho) | | SMS | Zixflow (OTP / Transactional) |

Credentials are injected at call time by your worker/service — nothing is hardcoded in this package.


Install

npm install @janooma/jms-core

Environment Variables

Create a .env.local file (already in .gitignore) with the following variables:

Email — ZeptoMail

| Variable | Required | Description | |---|---|---| | ZEPTOMAIL_API_KEY | ✅ | API key from ZeptoMail dashboard | | ZEPTOMAIL_BASE_URL | ✅ | API base URL, e.g. https://api.zeptomail.in | | ZEPTOMAIL_FROM | ✅ | Verified sender email address | | ZEPTOMAIL_FROM_NAME | ☑️ | Display name for sender | | ZEPTOMAIL_TO | ✅ | Recipient email address | | ZEPTOMAIL_TO_NAME | ☑️ | Display name for recipient | | ZEPTOMAIL_SUBJECT | ☑️ | Email subject line | | ZEPTOMAIL_HTML | ☑️ | HTML body |

SMS — Zixflow

| Variable | Required | Description | |---|---|---| | ZIXFLOW_API_KEY | ✅ | API key from Zixflow dashboard | | ZIXFLOW_SENDER_ID | ✅ | Registered sender ID (e.g. JANOMA) | | ZIXFLOW_ROUTE | ✅ | Route type: otp, transactional, or promotional | | ZIXFLOW_TO | ✅ | Recipient mobile number with country code, e.g. 919886627324 | | ZIXFLOW_MESSAGE | ✅ | SMS message body | | ZIXFLOW_DLT_TEMPLATE_ID | ☑️ | DLT template ID registered with your telecom operator | | ZIXFLOW_DLT_ENTITY_ID | ☑️ | DLT entity ID registered with your telecom operator |

✅ Required   ☑️ Optional


Usage

Send a plain email

import { EmailService, ZeptomailProvider } from '@janooma/jms-core';

const service = new EmailService(new ZeptomailProvider());

await service.sendEmail(
  {
    from: { email: '[email protected]', name: 'Janooma' },
    to: [{ email: '[email protected]', name: 'User Name' }],
    subject: 'Hello from Janooma',
    html: '<p>Welcome aboard!</p>',
  },
  {
    apiKey: env.ZEPTOMAIL_API_KEY,
    baseUrl: env.ZEPTOMAIL_BASE_URL,
  },
);

Send a template email

Use {{token}} placeholders in subject, html, and text. They are replaced at send time with the variables map.

import { EmailService, ZeptomailProvider } from '@janooma/jms-core';

const service = new EmailService(new ZeptomailProvider());

await service.sendTemplateEmail(
  {
    from: { email: '[email protected]', name: 'Janooma' },
    to: [{ email: '[email protected]', name: 'Madan' }],
    template: {
      subject: 'Hi {{name}}, your OTP is ready',
      html: '<h1>Hello {{name}}</h1><p>Your OTP is <b>{{otp}}</b>. Never share it with anyone.</p>',
    },
    variables: {
      name: 'Madan',
      otp: 123456,
    },
  },
  {
    apiKey: env.ZEPTOMAIL_API_KEY,
    baseUrl: env.ZEPTOMAIL_BASE_URL,
  },
);

Send an SMS (OTP)

import { SmsService, ZixflowProvider } from '@janooma/jms-core';

const service = new SmsService(new ZixflowProvider());

await service.sendSms(
  {
    to: '919886627324',
    message: 'Use 123456 to complete your transaction on JANOOMA. Never share your OTP with anyone.',
    route: 'otp',
    dltTemplateId: env.ZIXFLOW_DLT_TEMPLATE_ID,
    dltEntityId: env.ZIXFLOW_DLT_ENTITY_ID,
  },
  {
    apiKey: env.ZIXFLOW_API_KEY,
    senderId: env.ZIXFLOW_SENDER_ID,
  },
);

Use MessagingClient (email + SMS together)

import { MessagingClient, ZeptomailProvider, ZixflowProvider } from '@janooma/jms-core';

const client = new MessagingClient({
  emailProvider: new ZeptomailProvider(),
  smsProvider: new ZixflowProvider(),
});

// Email
await client.email.sendTemplateEmail({ ... }, { apiKey, baseUrl });

// SMS
await client.sms.sendSms({ ... }, { apiKey, senderId });

SendResult

Every send method returns a SendResult:

interface SendResult {
  success: boolean;
  provider: string;       // 'zeptomail' | 'zixflow'
  messageId?: string;
  error?: string;         // set when success is false
  raw?: unknown;          // full raw API response
}

Package scripts

| Script | Description | |---|---| | npm run build | Compile TypeScript to dist/ | | npm run typecheck | Type-check without emitting | | npm run test | Run unit tests | | npm run live:email | Send a real email using .env.local | | npm run live:sms | Send a real SMS using .env.local |


Live test

Copy the example below into .env.local and fill in your credentials, then run the live scripts.

# ZeptoMail
ZEPTOMAIL_API_KEY=your-zeptomail-api-key
ZEPTOMAIL_BASE_URL=https://api.zeptomail.in
[email protected]
ZEPTOMAIL_FROM_NAME=Your App
[email protected]
ZEPTOMAIL_TO_NAME=Recipient Name
ZEPTOMAIL_SUBJECT=Test Email
ZEPTOMAIL_HTML=<div><b>Test email sent successfully.</b></div>

# Zixflow
ZIXFLOW_API_KEY=your-zixflow-api-key
ZIXFLOW_SENDER_ID=YOURID
ZIXFLOW_ROUTE=otp
ZIXFLOW_TO=91xxxxxxxxxx
ZIXFLOW_MESSAGE=Use 123456 to complete your transaction. Never share your OTP.
ZIXFLOW_DLT_TEMPLATE_ID=your-dlt-template-id
ZIXFLOW_DLT_ENTITY_ID=your-dlt-entity-id
npm run live:email
npm run live:sms

Publish

npm run build
npm login
npm publish --access public