0.11.2 • Published 5 years ago

carina v0.11.2

Weekly downloads
257
License
MIT
Repository
github
Last release
5 years ago

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;
}
0.11.2

5 years ago

0.11.1

5 years ago

0.12.0

5 years ago

0.11.0

6 years ago

0.10.0

6 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.8.0

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.5.4

7 years ago

0.5.3

8 years ago

0.5.2

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago