# tiramitzu-moe-ws

> A Node.js wrapper around LISTEN.moe websocket api. (cloned and edited just for me xd)

Latest version **1.0.7** (published 2020-04-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install tiramitzu-moe-ws
pnpm add tiramitzu-moe-ws
yarn add tiramitzu-moe-ws
bun add tiramitzu-moe-ws
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2020-04-22 |
| First published | 2020-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Original: Deivu |
| Maintainers | tiramitzu |
| Keywords | tiramitzu, hidden, private |

## Links

- npm: https://www.npmjs.com/package/tiramitzu-moe-ws
- Repository: https://github.com/Deivu/Harusame
- Homepage: https://github.com/Deivu/Harusame#readme
- Issues: https://github.com/Deivu/Harusame/issues
- npm.io page: https://npm.io/package/tiramitzu-moe-ws

## Dependencies (1)

- [ws](https://npm.io/package/ws.md) ^7.2.1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2020-04-22

## README

## Harusame
<p align="center">
  <img src="https://vignette.wikia.nocookie.net/kancolle/images/3/3f/Harusame_Valentine_Full.png">
</p>

Please don't use this, use the original npm! (This npm only support for JPOP listen.moe)

The ShipGirl Project. Harusame `(c) Kancolle for Harusame`

### Installation
Master
```
npm i Deivu/Harusame
```
Stable
```
npm i Harusame
```

### Examples
For invoked type code example, check [Client-Invoked.js](https://github.com/Deivu/Harusame/blob/master/tests/Client-Invoked.js)

For event driven code example, check [Client-Event.js](https://github.com/Deivu/Harusame/blob/master/tests/Client-Event.js)

### Documentation

> Harusame Client Options
```js
// Default Options
const { Harusame } = require('harusame');
new Harusame({ attempts: 3, interval: 5000 });
```
| Name             | Description
|------            |------
|`options.attempts`| Specifies how much Harusame will retry to connect to LISTEN.moe ws before you manually reconnect. Defaults to 3.
|`options.interval`| Specifies the interval between reconnects. Defaults to 5000 ms.

> Harusame Events
```js
const client = new Harusame()
  .on('debug', (name, msg) => console.log(`Websocket Name: ${name}, Debug Message: ${msg}`))
  .on('error', (name, error) => console.error(`Websocket Name: ${name}`, error))
  .on('close', (name, reason) => console.log(`Websocket Name: ${name}, Close Data: ${reason}`))
  .on('open', (name) => console.log(`Websocket Name: ${name} is now open.`))
  .on('ready', (name) => console.log(`Websocket Name: ${name} is now ready`))
  .on('songUpdate', (name, data) => console.log(`Websocket Name: ${name}, Song:`, data));
```
| Name       | Description
|------      |------
|`debug`     | Emitted when a debug message is fired.
|`error`     | Emitted when an error was thrown when handling something. **must be handled**
|`close`     | Emitted when a websocket connection closed.
|`open`      | Emitted when a websocket connection is opened.
|`ready`     | Emitted when a websocket connection is ready.
|`songUpdate`| Emitted when a new track is playing at LISTEN.moe.

> Harusame Properties & Methods
```js
const client = new Harusame()
  .on('error', (name, error) => console.error(`Websocket Name: ${name}`, error));

console.log(client.config);
console.log(client.song);

// Connect or Destroy JPOP LISTEN.moe WS
client.connect('JPOP'); 
client.destroy('JPOP');

// Connect or Destroy KPOP LISTEN.moe WS
client.connect('KPOP'); 
client.destroy('KPOP');
```

- Properties

`client.config` => returns the config you have set to Harusame.

`client.song` => returns an object with two keys, which is **JPOP** and **KPOP**.

- Methods

`client.connect()` => connects the WS you want.

`client.destroy()` => destroys the WS you want.

---
_Source: https://npm.io/package/tiramitzu-moe-ws · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
