Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

urbit

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urbit

Library to interact with an Urbit ship

Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
3
-25%
Maintainers
1
Weekly downloads
 
Created
Source

Urbit Connector

This project allows you to connect to an Urbit ship via a JavaScript application. See code below for an example of how to do so.

const Urbit = require('./dist').default;

// Assuming
// a) you are running a fakezod on port 8080
// b) you have created a chat called 'mc' on that fakezod,
const url = 'localhost';
const port = 8080;
const code = 'lidlut-tabwed-pillex-ridrup';

async function mars() {
    const ship = new Urbit(`http://${url}:${port}`, code);
    console.log(ship.channelUrl);
    await ship.connect();
    await ship.subscribe('zod', 'chat-store', '/mailbox/~/~zod/mc');
    const pipe = ship.eventSource();
    await ship.poke('zod', 'chat-hook', 'json', {message: {path: '/~/~zod/mc', envelope: {
        uid: Urbit.uid(),
        number: 1, // Dummy, gets overwritten immediately
        author: '~zod',
        when: new Date().getTime(),
        letter: { text: 'This is it' }
    }}});
}

mars();
console.log('Press ctrl-c to quit');

FAQs

Package last updated on 16 Jul 2020

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