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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@dewaratsingh/smssender

v1.0.8

Published

A lightweight Node.js package to send SMS messages from your server using a connected Android device. It uses **Socket.IO** to communicate with your Android app, enabling real-time SMS sending and status updates.

Downloads

737

Readme

SmsSender

A lightweight Node.js package to send SMS messages from your server using a connected Android device.
It uses Socket.IO to communicate with your Android app, enabling real-time SMS sending and status updates.


🚀 Features

  • Start an SMS server easily
  • Send SMS from Node.js
  • Receive delivery status events
  • Works over local network / hotspot
  • Simple API with minimal setup

📥 Installation

npm install @dewaratsingh/smssender

📘 Usage Example (Express.js + Socket.IO)

Below is a fully working server example that:

  • ✔ Starts the SMS server
  • ✔ Sends an SMS when someone visits /
  • ✔ Receives SMS sending status from Android
  • ✔ Uses a single HTTP + Socket.IO server
const express = require("express");
const http = require("http");
const { startSmsServer, sendSMS, onSMSStatus } = require("smssender");

const app = express();
const port = 3000;

// Create an HTTP server (needed for Socket.IO)
const server = http.createServer(app);

// Start SMS server (Socket.IO + internal logic)
startSmsServer({ server, port });

// Listen for SMS status updates from Android
onSMSStatus((data) => {
 console.log("SMS Status received:", data);
});

// Route to test SMS sending
app.get("/", (req, res) => {
 res.send("Hello World!");

 // Send an SMS when user visits this route
 sendSMS("+911234567890", "hi hello i am pawan");
});

// Start the server
server.listen(port, "0.0.0.0", () => {
 console.log(`Server running on http://0.0.0.0:${port}`);
 console.log(`Socket.IO attached to the same port`);
});

📡 How It Works

1. startSmsServer()

Starts the internal Socket.IO server on your Node.js app.

startSmsServer({ server, port });

| Name | Type | Description | | ------ | ----------- | ----------------------------- | | server | http.Server | Existing HTTP server instance | | port | number | Port to run Socket.IO server |

2. sendSMS(phoneNumber, message)

Sends an SMS through the connected Android device.

sendSMS("+911234567890", "Your message here");

3. onSMSStatus(callback)

Listens for SMS sending or delivery status from Android.

onSMSStatus((data) => {
  console.log("SMS Status received:", data);
});

Example status:

{
  "to": "+911234567890",
  "status": "sent",
  "timestamp": 1700000000
}

📱 Android App Requirement

You need the companion Android app that:

  • Connects to your Node.js server
  • Receives SMS request
  • Sends SMS using native Android API
  • Sends delivery status events

(Add your Android app GitHub / APK link here)

🛜 Network Requirement

Both devices must be on the same WiFi / hotspot / LAN.

🧑‍💻 Author

Dewarat Singh NPM: @dewaratsingh

📄 License

MIT License You may use, modify, and distribute this package freely with credit.