@sebbo2002/vestaboard
TypeScript icon, indicating that this package has built-in type declarations

3.1.0 • Public • Published

Logo

@sebbo2002/vestaboard

MIT LICENSE CI Status


Just another client for the Vestaboard APIs. It supports the Subscription API, Read/Write API and the Local API. Written in Typescript.

The library also provides a small collection of helpers to format messages on the Vestaboard. This includes a write() method that automatically wraps text, a fill() method to fill the board with nice characters, or table() to conjure up a table on the board.

📦 Installation

npm i --save @sebbo2002/vestaboard

⚡️ Quick Start

Draw some patterns using the Subscription API

import { SubscriptionAPI, Message } from '@sebbo2002/vestaboard';
const api = new SubscriptionAPI('3eadf7a8-6602-4bf5-92f4-970d36066958', '******************************');
const msg = new Message().fill('🟥🟧🟨🟩🟦🟪');

api.postMessage(msg);

Write a calendar on a local Vestaboard

import { LocalAPI, Message } from '@sebbo2002/vestaboard';
const api = new LocalAPI('***');
const msg = new Message().table([
  ['now', 'Daily'],
  ['13:00', 'Super Secret Meeting'],
  ['16:30', 'Awesome Presentation']
]);

api.postMessage(msg);

Write Hello World on multiple local boards

import { MultipleBoards, LocalAPI, Message } from '@sebbo2002/vestaboard';
const board1 = new LocalAPI('***');
const board2 = new LocalAPI('***');
const boards = new MultipleBoards([board1, board2]);

boards.postMessage('Hello World');

See the examples folder for more examples.

📑 API-Reference

🚦 Tests

Some unit tests use the Vestaboard API to run the tests. You can use the .env.example file as a template and enter your data there accordingly.

npm test
npm run coverage

🙆🏼‍♂️ Copyright and license

Copyright (c) Sebastian Pekarek under the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i @sebbo2002/vestaboard

Weekly Downloads

1,014

Version

3.1.0

License

MIT

Unpacked Size

128 kB

Total Files

9

Last publish

Collaborators

  • sebbo2002