# w-spot-ws

> Web socket implementation of w-spot

Latest version **1.1.2** (published 2017-11-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install w-spot-ws
pnpm add w-spot-ws
yarn add w-spot-ws
bun add w-spot-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.1.2 |
| Published | 2017-11-20 |
| First published | 2017-11-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7.6 |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | okunishinishi |
| Maintainers | realglobe, okunishinishi |
| Keywords | the |

## Links

- npm: https://www.npmjs.com/package/w-spot-ws
- Repository: https://github.com/realglobe-Inc/w-spot-ws
- Homepage: https://github.com/realglobe-Inc/w-spot-ws#readme
- Issues: https://github.com/realglobe-Inc/w-spot-ws/issues
- npm.io page: https://npm.io/package/w-spot-ws

## Dependencies (2)

- [ws](https://npm.io/package/ws.md) ^3.3.1
- [w-spot](https://npm.io/package/w-spot.md) ^2.0.1

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.1.2 (latest) — 2017-11-20
- 1.1.1 — 2017-11-20
- 1.1.0 — 2017-11-18
- 1.0.3 — 2017-11-17
- 1.0.2 — 2017-11-17
- 1.0.1 — 2017-11-17

## README

w-spot-ws
==========

<!---
This file is generated by ape-tmpl. Do not update manually.
--->

<!-- Badge Start -->
<a name="badges"></a>

[![Build Status][bd_travis_shield_url]][bd_travis_url]
[![npm Version][bd_npm_shield_url]][bd_npm_url]
[![JS Standard][bd_standard_shield_url]][bd_standard_url]

[bd_repo_url]: https://github.com/realglobe-Inc/w-spot-ws
[bd_travis_url]: http://travis-ci.org/realglobe-Inc/w-spot-ws
[bd_travis_shield_url]: http://img.shields.io/travis/realglobe-Inc/w-spot-ws.svg?style=flat
[bd_travis_com_url]: http://travis-ci.com/realglobe-Inc/w-spot-ws
[bd_travis_com_shield_url]: https://api.travis-ci.com/realglobe-Inc/w-spot-ws.svg?token=
[bd_license_url]: https://github.com/realglobe-Inc/w-spot-ws/blob/master/LICENSE
[bd_codeclimate_url]: http://codeclimate.com/github/realglobe-Inc/w-spot-ws
[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/realglobe-Inc/w-spot-ws.svg?style=flat
[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/realglobe-Inc/w-spot-ws.svg?style=flat
[bd_gemnasium_url]: https://gemnasium.com/realglobe-Inc/w-spot-ws
[bd_gemnasium_shield_url]: https://gemnasium.com/realglobe-Inc/w-spot-ws.svg
[bd_npm_url]: http://www.npmjs.org/package/w-spot-ws
[bd_npm_shield_url]: http://img.shields.io/npm/v/w-spot-ws.svg?style=flat
[bd_standard_url]: http://standardjs.com/
[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

<!-- Badge End -->


<!-- Description Start -->
<a name="description"></a>

Web socket implementation of w-spot

<!-- Description End -->


<!-- Overview Start -->
<a name="overview"></a>



<!-- Overview End -->


<!-- Sections Start -->
<a name="sections"></a>

<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->

<a name="section-doc-guides-01-installation-md"></a>

Installation
-----

```bash
$ npm install w-spot-ws --save
```


<!-- Section from "doc/guides/01.Installation.md.hbs" End -->

<!-- Section from "doc/guides/02.Usage.md.hbs" Start -->

<a name="section-doc-guides-02-usage-md"></a>

Usage
---------

```javascript
'use strict'

const wSpotWS = require('w-spot-ws')

async function tryExample () {
  // Create multiple spot
  const NewYork = wSpotWS.client()
  const HongKong = wSpotWS()
  const Japan = wSpotWS.client()

  const port = 8080

  await HongKong.listenAsServer(port)
  await NewYork.connectAsClient(`ws://localhost:${port}`)
  await Japan.connectAsClient(`ws://localhost:${port}`)

  {
    class Person {
      async hi (msg) {
        return `hi, ${msg}`
      }
    }

    // Create a instance to a spot
    const john = NewYork.load(Person, 'jp.realglobe.new-york.john')
    await john.hi('I am in NewYork!')
  }

  {
    // Use remote instance
    const john = Japan.use('jp.realglobe.new-york.john')
    await john.hi('Calling from Japan!')
  }

}

tryExample().catch((err) => console.error(err))

```


<!-- Section from "doc/guides/02.Usage.md.hbs" End -->

<!-- Section from "doc/guides/10.API Guide.md.hbs" Start -->

<a name="section-doc-guides-10-a-p-i-guide-md"></a>

API Guide
-----

+ [w-spot-ws@1.1.2](./doc/api/api.md)
  + [create(args)](./doc/api/api.md#w-spot-ws-function-create)
  + [WSpotWS](./doc/api/api.md#w-spot-w-s-class)


<!-- Section from "doc/guides/10.API Guide.md.hbs" End -->


<!-- Sections Start -->


<!-- LICENSE Start -->
<a name="license"></a>

License
-------
This software is released under the [MIT License](https://github.com/realglobe-Inc/w-spot-ws/blob/master/LICENSE).

<!-- LICENSE End -->


<!-- Links Start -->
<a name="links"></a>

Links
------

+ [w][w_url]
+ [Realglobe, Inc.][realglobe,_inc__url]

[w_url]: https://github.com/realglobe-Inc/w
[realglobe,_inc__url]: http://realglobe.jp

<!-- Links End -->

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