JSPM

  • Created
  • Published
  • Downloads 14415
  • Score
    100M100P100Q127533F
  • License MIT

JavaScript library for the Twitch Messaging Interface.

Package Exports

  • tmi.js
  • tmi.js/index.js
  • tmi.js/lib/utils
  • tmi.js/lib/utils.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tmi.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tmi.js

Test Workflow Status Npm Version Downloads Issues Node Version

Website | Documentation currently at tmijs/docs | Changelog on the release page

Install

Node

$ npm i tmi.js
const tmi = require('tmi.js');
const client = new tmi.Client({
    options: { debug: true },
    identity: {
        username: 'bot_name',
        password: 'oauth:my_bot_token'
    },
    channels: [ 'my_channel' ]
});
client.connect().catch(console.error);
client.on('message', (channel, tags, message, self) => {
    if(self) return;
    if(message.toLowerCase() === '!hello') {
        client.say(channel, `@${tags.username}, heya!`);
    }
});

Browser

Available as "tmi" on window.

<script src="/scripts/tmi.min.js"></script>
<script>
const client = new tmi.Client({ /* ... */ });
client.connect().catch(console.error);
</script>

Prebuilt Browser Releases

Release page

Build Yourself

$ git clone https://github.com/tmijs/tmi.js.git
$ npm install
$ npm run build

Type Definitions

$ npm i -D @types/tmi.js

Community

Contributors

Thanks to all of the tmi.js contributors!

Contributing guidelines

Please review the guidelines for contributing of the tmi.js repository. We reserve the right to refuse a Pull Request if it does not meet the requirements.