Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@replit/crosis

6.0.0-beta.11 • Public • Published

Run on Repl.it

Generated docs https://replit-crosis--masfrost.repl.co/

Installation

yarn add @replit/crosis @replit/protocol

Crosis relies on the @replit/protocol package as a peer dependency. https://github.com/replit/protocol

Exported

You probably don't need this but it's exported: Channel

Usage

You should probably familiarize yourself with the protocol before trying to use it. Crosis is just a client that helps you connect and communicate with the container using the protocol.

Read about the protocol here http://protodoc.turbio.repl.co

Here's an example of connecting then opening an eval channel and sending it an eval command

import { Client } from '@replit/crosis';
 
const client = new Client();
 
const token = await fetch(TOKEN_URL).then((r) => r.text());
 
await client.connect({ token });
 
const channel = client.openChannel({
  name: 'evaller',
  service: 'eval',
});
 
channel.on('cmd', (cmd) => {
  console.log(cmd);
});
channel.send({ eval: '1+1' });

Keywords

none

Install

npm i @replit/crosis

DownloadsWeekly Downloads

1,055

Version

6.0.0-beta.11

License

UNLICENSED

Unpacked Size

81.6 kB

Total Files

22

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar