New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

mppclone-cmapi

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mppclone-cmapi

MPPClone custom message API

latest
Source
npmnpm
Version
1.8.0
Version published
Weekly downloads
9
-43.75%
Maintainers
1
Weekly downloads
 
Created
Source

cmapi

cmapi stands for custom message api. This module is meant to be used on MPPClone. It is meant to make the use of custom messages easier.

UPDATE

Apparently unpkg is terrible, so use https://cdn.jsdelivr.net/npm/mppclone-cmapi@latest/dist/cmapi.dist.js instead.

Usage

To use this module, first instantiate it on the client, then you're free to use it as you wish.

The module can detect whether or not your client is already connected, so you can choose to construct it at any point in time, but only once per client.

Node

const cmapi = require('mppclone-cmapi');
const Client = require('mppclone-client');

const client = new Client("wss://mppclone.com:8443", process.env.MPPCLONE_TOKEN);
const cm = new cmapi(client);

client.start();
client.setChannel('test/awkward');

client.on('hi', msg => {
    console.log('Connected to server');
});

cmapi.on('hello', msg => {
    console.log('Received hello');
});

Browser

If you're using a userscript manager such as tampermonkey, you can add a @require tag to your userscript header. Otherwise, you can use webpack or a script tag.

// @require     https://unpkg.com/mppclone-cmapi@latest/dist/cmapi.dist.js
<script src="https://unpkg.com/mppclone-cmapi@latest/dist/cmapi.dist.js"></script>

The usage is the same as Node, however, you don't have to create a client.

MPP.cmapi = new cmapi(MPP.client);

MPP.client.on('hi', msg => {
    console.log('Connected to server');
});

MPP.cmapi.on('hello', msg => {
    console.log('Received hello');
});

Keywords

mppclone

FAQs

Package last updated on 10 Jan 2023

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