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

lonely

v0.1.3

Published

Test Google+ Hangouts apps all by your lonesome

Downloads

10

Readme

Lonely Hangouts

Local testing for the Google+ Hangouts API By Dan Vanderkam

Google+ Hangouts provide an API very reminiscent of the Google Wave Gadgets API, which later became the Google Shared Spaces API. This API makes it easy to create collaborative web apps without worrying about backend synchronization or edit conflicts.

The API is great, but the iteration process (which requires pushing everything to an external server or two) leaves something to be desired.

It's also difficult to test multiplayer scenarios because you need a separate Google+ account and a separate computer for each player.

While developing Puzzle+, this became frustrating enough that I developed Lonely Hangouts as a workaround. It solves both of these problems by letting you hang out all by yourself (hence the name!). It provides a node.js server which emulates a portion of the Google+ Hangouts API. It does not require accounts and loads all resources from local disk.

Installation

Lonely Hangouts requires node.js.

Once you have node, run:

npm install lonely

Usage

To use Lonely Hangouts, run:

./node_modules/.bin/lonely your_app.xml

Then connect to http://localhost:8080 in your browser. You can open the URL in an incognito window or another browser to create a second user.

For a quick demo, you can try cloning this repo and running:

./lonely.js demos/basic.xml

If you change your XML file or any of the resources that it includes, you'll need to refresh the page in your browser. This will not erase the existing app state.

For extra-speedy testing, Lonely has a single player mode:

./node_modules/.bin/lonely.js --single your_app.xml

Now you can only create a single user, but there is no server-side state. This lets you iterate on your layout and design just like you would in a normal web page.

Rewrites

In a published Hangout App, resources must be hosted at a public https location. But for local development, it's much more convenient to use local versions of the resources.

To accomodate this, Lonely uses simple rewrites. Write out the full external path in your XML file, then specify a rewrite which converts it to a local path. When you run the App with Lonely, the rewrites will be used. When you push the XML file to G+, the rewrites will be ignored.

Here's what a rewrite looks like (see also demos/basic.xml):

<!-- lonely
{
rewrites: [
  {
    from: "https://raw.github.com/danvk/lonely/master/",
    to: ""
  }
]
}
-->

This is nothing more than a search/replace. It will change script sources, image sources and JavaScript sources, but also links and URLs in plain text.

Paths are relative to the directory from which you started the server.

Remaining work

There are many methods of the G+ Hangouts API which are not currently implemented in Lonely Hangouts. For a complete API reference, see: https://developers.google.com/+/hangouts/api/

Other useful features would include:

  • A "reset state" button
  • A facility for saving/restoring state