The JavaScript blog.


libraries node modules express connect iojs json-schema

Node Roundup: Unifying Node with io.js, JSON Object to JSON Schema, conveyor-belt

Posted on .

StrongLoop on Unifying Node with io.js

The StrongLoop blog has a post by Issac Roth about the unification of Node and io.js:

Unification is something you can help with! The io.js repository and the Node Google group are open to all. Get involved, post issues and comments, let people know your ideas and solutions. Tell people where you stand on the issue. I've worked with all of the contributors in small or large ways and they are each kind people--if they hear from a wide swath of the community something you want, it will surely get considered, as everyone I've met likes to serve the community.

Issac is involved with both the Node Advisory Board and Node Forward. Bert Belder, also at StrongLoop, is also involved with these groups as well, and works with Issac. This post gives a good insight into what's happening with Node and io.js, which is sometimes bewildering to outsiders, particularly if you pay attention enough to see core contributors switching to io.js with seemingly no explanation.

And, according to Issac, the technical divergence between the projects might not be as extreme as some people make out:

Having witnessed some of the early discussions between the io.js technical committee and the Joyent contributors, there are only a small number of points of disagreement on both governance (stuff like how voting would happen if needed) and technical decisions (stuff like which version of v8 to use in the next release.)

He ends saying that he's confident that we'll end up with a single Node project. I don't personally have a problem with forks existing, but it would make my life easier if I only had to write about one "Node".

JSON Object to JSON Schema

Nijiko Yonskai, who has sent in several small but perfectly well-formed Node modules, has recently published JSON Object to JSON Schema (GitHub: Nijikokun/generate-schema, License: MIT, npm: generate-schema). This project helps you to convert JSON objects to schemas:

var GenerateSchema = require('generate-schema')

  "_links": {
    "self": {
      "href": "/gists/42"
    "star": {
      "href": "/gists/42/star"
  "id": "42",
  "created_at": "2014-04-14T02:15:15Z",
  "description": "Description of Gist",
  "content": "String contents"

This outputs an object with the types based on the content, so in this case it's mostly { "type": "string" }. I've recently been creating JSON schemas from existing JSON data sets, so this would have made my job easier!


Svilen Gospodinov sent in conveyor-belt (GitHub: svileng/conveyor-belt, License: MIT, npm: conveyor-belt). It's designed to switch client-side assets based on the current environment, so you can easily load development mode client-side scripts with lots of logging.

It looks like it'll work well with Connect/Express-based applications, but you could use it with other frameworks as well.


libraries JSON node modules react json-schema

Syphon, json-schema-benchmark

Posted on .


Syphon (GitHub: scttnlsn/syphon, License: MIT, npm: syphon) by Scott Nelson is an implementation of the Flux architectural pattern for React. It helps you to structure applications around a single immutable state value, and implements the dispatching of actions to various state-transitioning handler functions.

The application's state is stored in an immutable data structure that you create with the atom method. To access a value, you deref it, and you can also modify it by using swap:

var state = syphon.atom({ foo: 'bar' });

state.swap(function(current) {  

  return current.set('foo', 'baz');

// => { foo: 'baz' }

Responding to state changes involves writing handlers, which takes the form of functions with two arguments: value and currentState. The application's state is available in the second argument.

Syphon's author recommends using the multimethod module to deal with handlers that branch on multiple values.

Syphon includes the root method for mounting your component hierarchy, and a mixin for adding helpers to components for accessing application data and dispatch values.


I may need to create some JSON schemas in the near future, so it was fortunate that Allan Ebdrup sent in json-schema-benchmark. This is a benchmark for JSON schema validators, and covers the following modules:

It also shows test failures when run against the official JSON Schema Test Suite. One cool addition is a summary of tests that caused side-effects, so you can see which validators altered values.