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

hilink-nodejs-sms

v2.0.3

Published

Node.js library to send sms using Huawei modems (hilink).

Downloads

132

Readme

hilink-nodejs-sms

Node.js library to send sms from Huawei routers/modems. Written in typescript.

Tested with latest software for Huawei E5573s-320, details:

  • Device name: E5573s-320
  • Hardware version: CL1E5573SM01
  • Software version: 21.326.62.00.264

Library should work with other devices compatible with Huawei Hilink software.

Installation

$ npm install hilink-nodejs-sms --save

Initialize object instance

Set at least login and hash of your password in the configuration

import HilinkSms from 'hilink-nodejs-sms';

const hilink = new HilinkSms({
  login: 'admin',
  sha256password: '5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8', // sha256('password')
  // silentLogs: false,                   // optional, turn on / turn off the logs (doesn't work if custom logger is defined)
  // logger: (info) => {                  // optional, custom logger
  //  console.log(`----- ${info} -----`);
  // },
  // name: 'E5573s-320',                  // optional, device name used to distinguish many devices
  // parallelSmsCount: 2,                 // optional, number of messages sent in parallel to the device
  // networkInterface: 'enx0c5b8f279a64', // optional, specify the network interface in case of multiple internet connections (linux only with curl installed)
  // host: '192.168.8.1',                 // optional
  // protocol: 'http'                     // optional
});

Send SMS

  hilink
    .sms('Hello!', '500600700')
    .then(() => { console.log('success!'); })
    .catch((e) => { console.log('fail!', e); })

or use async/await

  try {
    await hilink.sms('Hello!', '500600700');
    console.log('success!');
  } catch (e) {
     console.log('fail!', e);
  }

[typescript]

async sms(message: string, recipient: string | string[]): Promise<void>

parameter | Description | type --- | --- | --- message | SMS text | String recipient | phone number / numbers | String / Array of Strings

Destroy instance

It is important to release resources and avoid memory leaks! Internal implementation of SMS queue is based on timer - remember to clear it as soon as you stop using hilink-nodejs-sms functionality.

  hilink.destroy(); // IMPORTANT! remember to release resources!

After destroy method is called, sending SMS is no longer possible.

Caution

HUAWEI HILINK is trademark of Huawei Technologies Co., Ltd.