🚀 DAY 4 OF LAUNCH WEEK:Introducing Socket Scanning for OpenVSX Extensions.Learn more →
Socket
Book a DemoInstallSign in
Socket

@wishcore/wish-sdk

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wishcore/wish-sdk

Wish API for node. Used for building Wish Apps.

Source
npmnpm
Version
0.4.0-beta-10
Version published
Weekly downloads
176
-20%
Maintainers
1
Weekly downloads
 
Created
Source

Wish Api

A library for building Wish applications.

Install

npm install @wishcore/wish-sdk

Example

const { App } = require('@wishcore/wish-sdk');

const app = new App({
    name: process.env.SID || 'MyApp',
    corePort: parseInt(process.env.CORE, 10) || 9094,
    protocols: ['chat'] });

app.on('ready', (ready) => {
    app.request('identity.create', ['John Doe'], (err, data) => {
        if (err && data.code === 304) { return console.log('Using existing identity'); }
        console.log('Identity created:', err, data);
    });
});

app.on('online', (peer) => {
    app.request('services.send', [peer, Buffer.from('Permissionless innovation!')], (err, data) => {
        // sent or not?
    });
});

app.on('frame', (peer, data) => {
    app.request('identity.get', [peer.ruid], function(err, user) {
        console.log(user.alias, 'says:', data.toString());
    });
});

Keywords

wish

FAQs

Package last updated on 30 Jan 2021

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