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

portal-client

v1.1.1

Published

Portal client for Node.js

Downloads

8

Readme

Portal

The Portal is a concise, lightweight and feature-rich JavaScript library for real-time web application development. The Portal provides socket for browser-based and Node.js-based applications that need two-way communication with servers, but also aims to utilize a full duplex connection for modern web application development.

The Portal greatly simplifies things essential to real-time web applications like connection sharing, reply, heartbeat and disconnection detection. The Portal is designed by carefully considering known issues and best practices of real-time web to provide a reliable socket based on its simple protocol.

  • Website: http://flowersinthesand.github.io/portal/
  • Twitter: http://twitter.com/flowersits
  • Mailing list: https://groups.google.com/d/forum/portal_project

Test suite

Since this project follows Test Driven Development (TDD) principles well, looking at and running the test suite is a best way to understand the portal deeply. Every test has a title specifying a single behavior and is wrriten in QUnit.

  • client.js: Tests portal and socket using dummy and mock transport.
  • server.js: Tests transports by interacting with portal server.

Running

In order to run test suite, you need to have Node.js.

Clone this repository or simply download it as a zip and extract it.

git clone https://github.com/flowersinthesand/portal.git
cd portal

Install dependencies. If you are on Windows, you may have trouble in installing Contextify. See a installation guide from jsdom.

npm install

Start a server on localhost at port 8080.

node test/server

To test portal.js as a browser client, open http://localhost:8080 in a browser and to test it as a Node.js client, type node test/index in other console and see the result.

Writing server

A server passing the test suite is a very portal server. Writing portal server is not such hard. One of the goals of this project from day 1 (jquery-stream) is easy to implement in server-side as simple as dealing with Ajax. As various transports and features are added, it gets harder than dealing with Ajax, but still quite easy comparing to other similar projects. The portal server in test folder is less than 2KB minified and gzipped though it doesn't matter.

Anyway, the portal server for running test suite is a good example and tutorial to write portal server. check out server.js.