New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ensim

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ensim

Ensim official package for NodeJS.

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Ensim

Ensim official npm package for communicating with sim.

Install

npm i -g ensim

Usage

Create an instance and pass token as argument

const ensim = require("ensim");

const auth = "auth_xxxxxxxx";

let sim = new ensim(auth);

Add listeners to listen for events from our server and your sim

const ensim = require("ensim");

const auth = "auth_xxxxxxxx";

let sim = new ensim(auth);

sim.on("connect", () => {
    console.log("connected to server as: " + sim.id); // connected to server as: xxxxxxxx
});

sim.login(function(obj){
    if(obj.error){
        console.log(obj.message); // Invalid Auth Token
    }else{
        console.log(obj.message); // Authorized
    }
})

sim.on("message", function(obj){
    console.log(obj); //{ auth: 'auth_xxxxxxxx', message: 'Hello Yello!', sender: 'MTN', pend: true }
})

sim.on("offline", function(msg){
    console.log("Sim is offline!"); // Sim is offline!
})

sim.on("online", function(msg){
    console.log("Sim is online!"); // Sim is online!
})

Run USSD codes

sim.ussd("*556#", function(obj){
    // Handle Response
})

To test your sim run command on terminal after installation.

ensim auth_xxxxxxxx

Keywords

FAQs

Package last updated on 08 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc