Popularity
3.0
Stable
Activity
0.0
Stable
1,019
15
29

Description

Mesh is a utility library that makes it easy to rangle sophisticated data flows. Easily connect things together such as mongodb, pubnub, socket.io webrtc and more to build powerful features such as rollbacks, offline-mode, and realtime data.

Here's a basic example:

Code Quality Rank: L5
Monthly Downloads: 0
Programming language: JavaScript
License: ISC License
Latest version: v8.0.12

mesh alternatives and similar libraries

Based on the "Functional Programming" category.
Alternatively, view mesh alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of mesh or a related project?

Add another 'Functional Programming' Library

README

⚠️ This library is no longer maintained, and should not be used in production applications.

Build Status Coverage Status Join the chat at https://gitter.im/crcn/mesh.js

Mesh is a utility library for async iterable iterators.

Motivation

This library was originally created to handle complex data flows, and unify how applications communicate internally and externally. It also serves as a single channel for all communication which makes it more easy to control & reason about how your application is passing around data asynchronously.

Mesh provides a set of higher order functions that you can use to build your data flows out. Here's an example of that:

import { when, wrapAsyncIterableIterator, fallback } from "mesh";
import { 
  DS_FIND, 
  DS_INSERT, 
  DS_REMOVE, 
  DS_UPDATE, 
  dataStore, 
  DSFindMessage,
  whenCollection,
  DSInsertMessage,
  DSRemoveMessage,
  DSUpdateMessage,
} from "mesh-ds";

const insertTodoItem = (message: DSInsertMessage) => (
  wrapAsnycIterableIterator(fetch('/api/todos', {
    method: 'POST',
    body: message.data
  }))
);

const insert = fallback(
  whenCollection('todos', insertTodoItem),

  // more collections below
  // whenCollection('users', insertUser),
  // whenCollection('items', insertItem),
);

const dsDispatch = dataStore({
  [DS_INSERT] : insert,

  // other operations - similar code to insert
  //[DS_REMOVE] : remove,
  //[DS_UPDATE] : update,
  //[DS_FIND]   : find
});

<!-- TODO - rollback, -->

Installation

NPM: npm install mesh Bower: bower install mesh

Resources

  • Documentation
  • [Examples](./examples)
  • Modules
    • Data Store Adapters
      • [in-memory data store bus](./packages/mesh-memory-ds-bus)
      • [mongodb bus](./packages/mesh-mongo-ds-bus)
      • [lokijs bus](./packages/mesh-loki-ds-bus) - lokijs in-memory adapter
      • [local storate bus](./packages/mesh-local-storage-ds-bus) - local storage DS adapter
      • [array bus](./packages/mesh-collection-bus) - persist DS operations to an array collection
    • Realtime Protocol Adapters
      • [socket.io bus](./packages/mesh-socket-io-bus)
      • [webrtc bus](./packages/mesh-webrtc-bus)
    • Other Adapters
      • [http bus](./packages/mesh-http-bus) - HTTP request bus
    • Other Busses
      • [upsert ds action](./packages/mesh-webrtc-bus) - adds upsert (insert/update) action for DS busses
      • [tailable bus](./packages/mesh-tailable-bus) - adds ability to listen for all executed operations
      • [remote protocol adapter bus](./packages/mesh-remote-bus) - adapter bus for any realtime protocol
  • Discuss
  • Companies using Mesh
  • Articles