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 🙏

© 2024 – Pkg Stats / Ryan Hefner

eztexting-node

v0.0.19

Published

Send single, bulk, and individual bulk SMS and MMS with node-libcurl using the EZTexting REST API.

Downloads

9

Readme

eztexting-node

📨 Send single, bulk and bulk individual SMS and MMS with node-libcurl using the EZTexting REST API.

🔀 Requests are being send async via the libcurl Multi and Easy handler.

ℹ️ Messages are being sent and request responses are logged. Callback functions can be passed on.

Environment Dependencies

Create a .env file in your root folder and add 3 variables USR, PWD, and CRT_PATH:

USR=eztexting_user
PWD=eztexting_pa$$word
CRT_PATH=path/to/certificate/cert.pem

Dotenv : The worldwide standard for securing environment variables

Install Dev Dependencies

TypeScript

npm i @types/node eslint ts-node typescript --save-dev

Nodemon (optional)

I personally like to code TypeScript with nodemon

nodemon is a tool that helps develop Node.js based applications by automatically restarting the node application when file changes in the directory are detected.

Install: npm i nodemon --save-dev Script: tsc --project tsconfig.json

Send one message to a single phone number

import { Messages } from 'eztexting-node'
import { Message, ResponseFormat } from 'eztexting-node'

const format: ResponseFormat = 'json';

const singleMessage: Message = {
	PhoneNumbers: '2057404127', 
	Message: 'Single message', 
	StampToSend: '2022-10-10 16:15'
};

new Messages(format).sendMessage(singleMessage, callbackFn)

Send the same message to multiple phone numbers

import { Messages } from 'eztexting-node'
import { Message, ResponseFormat } from 'eztexting-node'

const format: ResponseFormat = 'json';

const bulkMessages: Message = { 
	PhoneNumbers: ['2057404127', '205-740-4177'], 
	Subject: "1", 
	Message: "Bulk message"
};

new Messages(format).sendMessage(bulkMessages, 'callback')

Send individual messages to specific phone numbers in bulk

import { Messages } from 'eztexting-node'
import { Message, ResponseFormat } from 'eztexting-node'

const format: ResponseFormat = 'json';

const Messages = new Messages(format)

const individualMessages: Message[] = [
	{PhoneNumbers: "2057404127", Subject: "1",Message: "Individual message 1"},
	{PhoneNumbers: "205-740-4177", Subject: "2",Message: "Individual message 2"},
	{PhoneNumbers: "(205) 740-4181", Subject: "3",Message: "Individual message 3"}
];

individualMessages.forEach(async (message: Message, i: number) => {

	messages.sendMessage(individualMessages, callback?)
});

Send a generated QR Code as picture to specific phone numbers

Create PNG Buffer with Promise handler


import { QRCodeGenerator, OutputFormat, StyleOptions } from ".";

const qr = new QRCodeGenerator();

qr.generate("png", "Willie")
	 .then((buffer: Buffer) => {var base64 = buffer.toString("base64")})
	 .catch((err: Error) => console.error(err));

Create SVG and save as file


const style: StyleOptions = {"width":300,"height":300,"data":"https://qr-code-styling.com","dotsOptions":{"type":"extra-rounded","color":"#6a1a4c"}}

const qr = new QRCodeGenerator();
qr.generate("svg", '', style);

// Optional parameter ([filename, dir])
// If no filename is passed, the filename is the current unix timestamp
qr.save("StyleWebsite");

Send QR Code to Phone Number

import { ResponseFormat } from 'eztexting-node'
const format: ResponseFormat = 'json';
const newMedia = new MediaFilesCreate(format);

const attendee: Attendee = {
	PhoneNumber: '2057404127', 
	Name: 'Winnie Puh',
	Barcode: 123456789
};

const mediaFileOptions = {filetype: 'png', url: 'https://url-of-png-file.png'}
newMedia.createMediaFile(attendee, mediaFileOptions, createMessageCallBackFn)

SSL Certification

https://github.com/JCMais/node-libcurl/blob/develop/COMMON_ISSUES.md