npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@swim/mesh

v3.11.1

Published

Multiplexed streaming WARP framework that runs in Node.js and web browsers

Downloads

20

Readme

@swim/mesh

package documentation chat

@swim/mesh implements a multiplexed streaming WARP client that runs in both Node.js and web browsers. @swim/mesh can be used in concert with the @swim/ui user interface toolkits to build massively real-time streaming applications. @swim/mesh is part of the broader @swim/system framework.

Framework

The @swim/mesh umbrella package depends on, and re-exports, the following component libraries:

  • @swim/warp (npm, doc) – WebSocket protocol for dynamically multiplexing large numbers of bidirectional links to streaming API endpoints, called lanes, of URI-addressed distributed objects, called nodes, that run stateful distributed processes, called Web Agents.
  • @swim/client (npm, doc) – streaming API client for linking to lanes of stateful Web Agents using the WARP protocol, enabling massively real-time applications that continuously synchronize all shared states with ping latency.

@swim/mesh builds on the @swim/core framework; it has no additional dependencies when run in a web browser, and depends only on a WebSocket implementation when run in Node.js.

Installation

npm

For an npm-managed project, npm install @swim/mesh to make it a dependency. TypeScript sources will be installed into node_modules/@swim/mesh/main. Transpiled JavaScript and TypeScript definition files install into node_modules/@swim/mesh/lib/main. And a pre-built UMD script, which bundles all @swim/mesh component libraries, can be found in node_modules/@swim/mesh/dist/main/swim-mesh.js.

Browser

Browser applications can load swim-mesh.js, along with its swim-core.js dependency, from the SwimOS CDN.

<!-- Development -->
<script src="https://cdn.swimos.org/js/latest/swim-core.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-mesh.js"></script>

<!-- Production -->
<script src="https://cdn.swimos.org/js/latest/swim-core.min.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-mesh.min.js"></script>

Alternatively, the standalone swim-system.js script may be loaded from the SwimOS CDN, which bundles @swim/mesh together with all other @swim/system frameworks.

<!-- Development -->
<script src="https://cdn.swimos.org/js/latest/swim-system.js"></script>

<!-- Production -->
<script src="https://cdn.swimos.org/js/latest/swim-system.min.js"></script>

Usage

ES6/TypeScript

@swim/mesh can be imported as an ES6 module from TypeScript and other ES6-compatible environments. All component libraries are re-exported by the umbrella @swim/mesh module.

import * as swim from "@swim/mesh";

CommonJS/Node.js

@swim/mesh can also be used as a CommonJS module in Node.js applications. All component libraries are re-exported by the umbrella @swim/mesh module.

var swim = require("@swim/mesh");

Browser

When loaded by a web browser, the swim-mesh.js script adds all component library exports to the global swim namespace. The swim-mesh.js script requires that swim-core.js has already been loaded.

The swim-system.js script also adds all @swim/mesh component library exports to the global swim namespace, making it a drop-in replacement for swim-mesh.js when additional @swim/system frameworks are needed.