@microsoft/signalr
ASP.NET Core SignalR Client
Last updated 19 days ago by anurse .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @microsoft/signalr 
SYNC missed versions from official npm registry.

JavaScript and TypeScript clients for SignalR for ASP.NET Core

Installation

npm install @microsoft/signalr

or

yarn add @microsoft/signalr

Usage

See the SignalR Documentation at docs.microsoft.com for documentation on the latest release. API Reference Documentation is also available on docs.microsoft.com.

Browser

To use the client in a browser, copy *.js files from the dist/browser folder to your script folder include on your page using the <script> tag.

WebWorker

To use the client in a webworker, copy *.js files from the dist/webworker folder to your script folder include on your webworker using the importScripts function. Note that webworker SignalR hub connection supports only absolute path to a SignalR hub.

Node.js

To use the client in a NodeJS application, install the package to your node_modules folder and use require('@microsoft/signalr') to load the module. The object returned by require('@microsoft/signalr') has the same members as the global signalR object (when used in a browser).

Example (Browser)

let connection = new signalR.HubConnectionBuilder()
    .withUrl("/chat")
    .build();

connection.on("send", data => {
    console.log(data);
});

connection.start()
    .then(() => connection.invoke("send", "Hello"));

Example (WebWorker)

importScripts('signalr.js');

let connection = new signalR.HubConnectionBuilder()
    .withUrl("https://example.com/signalr/chat")
    .build();

connection.on("send", data => {
    console.log(data);
});

connection.start()
    .then(() => connection.invoke("send", "Hello"));

Example (NodeJS)

const signalR = require("@microsoft/signalr");

let connection = new signalR.HubConnectionBuilder()
    .withUrl("/chat")
    .build();

connection.on("send", data => {
    console.log(data);
});

connection.start()
    .then(() => connection.invoke("send", "Hello"));

Current Tags

  • 3.1.4                                ...           latest (19 days ago)
  • 5.0.0-preview.4.20257.10                                ...           next (13 days ago)

19 Versions

  • 5.0.0-preview.4.20257.10                                ...           13 days ago
  • 3.1.4                                ...           19 days ago
  • 5.0.0-preview.3.20215.14                                ...           a month ago
  • 5.0.0-preview.2.20167.3                                ...           2 months ago
  • 3.1.3                                ...           2 months ago
  • 5.0.0-preview.1.20124.5                                ...           3 months ago
  • 3.1.2                                ...           3 months ago
  • 3.0.3                                ...           3 months ago
  • 3.1.0                                ...           6 months ago
  • 3.0.1                                ...           6 months ago
  • 3.1.0-preview3.19555.2                                ...           7 months ago
  • 3.1.0-preview2.19528.8                                ...           7 months ago
  • 3.1.0-preview1.19508.20                                ...           8 months ago
  • 3.0.0                                ...           8 months ago
  • 3.0.0-rc1.19457.4                                ...           9 months ago
  • 3.0.0-preview9.19424.4                                ...           9 months ago
  • 3.0.0-preview8.19405.7                                ...           10 months ago
  • 3.0.0-preview7.19365.7                                ...           10 months ago
  • 0.0.0                                ...           a year ago

Copyright 2014 - 2016 © taobao.org |