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 🙏

© 2026 – Pkg Stats / Ryan Hefner

moussaka-client

v0.1.9

Published

A javascript library that allows you to use javascript applications with the Moussaka prototyping framework.

Downloads

17

Readme

moussaka-client

A javascript library that allows you to use javascript applications with the Moussaka prototyping framework.

Build Status Coverage Status

Usage Example

  // Instantiate client
  var client = new MoussakaClient(opts);

  // Auto detect variable type
  var aNumber = client.registerVar('aNumber', 5);
  var aString = client.registerVar('aString', 'string beans');
  var aColor  = client.registerVar('aColor', new MoussakaClient.types.Color(1, 0, 0, 1)); // Moussaka type

  // Define specific schema
  var validatedNumber = client.registerVar('validatedNumber', 5, {
    type: 'float',
    min: 0,
    max: 100
  });

  // Start polling
  client.connect();

  while(running) {
    // Use Moussaka to adjust variables, MoussakaClient will poll for updates
    // and update the values accordingly.

    console.log(aNumber.value);
    console.log(aString.value);
    console.log(aColor.value.toString());
    console.log(validatedNumber.value);
  }

  // Stop polling afterwards
  client.disconnect();

Options

To instantiate MoussakaClient you must pass in an object with the following keys.

| Option | Desciption | Default | | ----------------- |-----------------------------------------------------------------------------------------------|-------------------------| | deviceName | The name of the device (i.e. John Smith's PC.) | None | | apiKey | The user API key retreived from the user account settings in Moussaka. | None | | projectId | The project ID retreived from the project view page in Moussaka. | None | | projectVersion | A string specifying the particular version of the project that this library is used in. | None | | serverUrl | The url to your Moussaka server. | http://localhost:3000/ | | pollInterval | The time in milliseconds between each poll to the server. | 1000 | | logLevel | See section below. | 2 (warning) |

Installing

It can be used directly in a node application or in the browser.

In Node:
  • Install the package through npm
npm install moussaka-client
  • Load the module
var MoussakaClient = require('moussaka-client');
var client = new MoussakaClient(opts);
In The Browser:

There are a few ways you can use it in the browser:

Get the package through bower:

bower install moussaka-client

The library bundle will be accessible at '/bower_components/moussaka-client/dist/moussaka-client[.min].js'. Then choose your favourite way to load up the module:

  • Consume it with CommonJS
var MoussakaClient = require('/path/to/moussaka-client.js');
  • Consume it with RequireJS
<script src="require.js"></script>
<script src="/path/to/moussaka-client.js"></script>
require('moussaka-client.js', function (MoussakaClient) {
  var client = new MoussakaClient(opts);
});
  • Just use it as a global on the window object
<script src="/path/to/moussaka-client.js"></script>
var client = new MoussakaClient(opts);
  • You could also just use the npm module in node and use Browserify to build your node application for the browser.

Log Level

By passing in a logLevel option you can control the detail of the log messages. The log levels are as follows:

  • trace: 0
  • info: 1
  • warning: 2
  • error: 3
  • exception: 4

For example, to see only messages that are errors or exceptions, you would pass { logLevel: 3 } to the MoussakaClient constructor.