Socket
Socket
Sign inDemoInstall

carina

Package Overview
Dependencies
1
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    carina

A NodeJS and Browser compatible client for Mixer.com's constellation socket.


Version published
Weekly downloads
25
increased by525%
Maintainers
1
Install size
895 kB
Created
Weekly downloads
 

Readme

Source

Carina Build Status

Installation

You can either use npm (recommended) or download the zip from the releases page.

Browser

<script src="js/carina.js"></script>

Node

npm i --save carina

Usage

Browser

index.html
<doctype html>
<html>
    <head>
        <title>Carina</title>
    </head>
    <body>
        <script src="js/carina.js"></script>
        <script src="js/app.js"></script>
    </body>
</html>
app.js
var ca = new carina.Carina().open();
ca.subscribe('channel:1:update', function (data) {
    console.log('Channel update', data);
});

Node

JavaScript
const Carina = require('carina').Carina;
const ws = require('ws');

Carina.WebSocket = ws;

// Note: You MUST set isBot if the client is
// an automated bot and you are NOT authing.
const ca = new Carina({ isBot: true }).open();
ca.subscribe('channel:1:update', data => {
    console.log('Channel update', data);
});
TypeScript
import { Carina } from 'carina';
import * as ws from 'ws';

Carina.WebSocket = ws;

const ca = new Carina({ isBot: true }).open();
ca.subscribe<ChannelUpdate>('channel:1:update', data => {
    console.log('Channel update', data);
});

// Example interface, does not contain all possible values.
interface ChannelUpdate {
    online?: boolean;
}

Keywords

FAQs

Last updated on 23 Jan 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc