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

realtime-service

v0.0.1

Published

Realtime Service

Downloads

1

Readme

Realtime Service

Status: Usable, but a work in progress. Feedback encouraged!

An open standard describing a mix of client and server-side code designed to communicate over a persistent connection. This will usually be a WebSocket connection, but any Realtime Transport module is compatible.

Realtime Services are designed to be very easy to understand, write, test and share on npm.

Each service is defined in the simplest possible way: as a plain old JavaScript object. Here's a simple example:

var service = {
  client: function(client) {
    client.onmessage = function(msg) {
      console.log('Message in from server:', msg);
    }
  },

  server: function(server) {
    setInterval(function(){
      server.broadcast('Hello!');  
    }, 1000);
  }
}

Examples Services

(all alpha quality for now)

rts-rpc
rts-pubsub
rts-livereload

Features

  • super-simple: services are just JavaScript objects
  • client and server code can expose APIs to be called by the app
  • easy to write tests
  • the realtime-service-client can run in a browser or separate node process
  • each service has it's own directory to store files (e.g. model definitions)
  • efficiently handles callbacks, even for non-JSON messages
  • services can optionally use Sessions (provided by the server)
  • server is notified when a client connect/disconnect (allowing cleanup)
  • services can send JavaScript assets to the browser
  • optionally handles JSON encoding/decoding for you
  • provides a standard logging API
  • ultra light weight client-side code (for sending to browser)

Realtime Services do not care about:

  • the underlying transport layer (abstracted away by Realtime Transport)
  • how code is delivered to the browser (left to the framework or app to implement)

Implementations

Realtime Services are currently implemented in Prism, the realtime server component of SocketStream 0.4.

As other frameworks / toolkits implement them, they will be listed here.

Contents

Realtime Services consist of

  1. This - the server-side library
  2. The realtime-service-client module
  3. The Realtime Server Spec (Coming soon!)

API

Coming soon!

History

Realtime Services are the evolution of an idea called "Request Responders" which first appeared in SocketStream 0.3. Despite a horribly clunky API, the idea proved to be popular with third-party modules for Backbone and Angular soon appearing.

Realtime Services will be one of the key features of SocketStream 0.4. However, I hope by ensuring the spec is a simple as possible (with minimal dependencies), other frameworks will support Realtime Services in the future. The ultimate goal is an ecosystem of reusable components using 100% standard npm packages.

Licence

MIT