kanso/kanso — pull request #332 by jhs (2011-12-10 01:46:15+00:00)
Title: An example of exporting a kanso.* type of API

Experiment for a Kanso API without requiring people to set `$NODE_PATH`.

This fixes the `package.json` file which was pointing "main" at a missing file. Now there is `src/api.js` which automatically exports anything in `src/kanso/*`.

The main problem is that all code must change from this:

foo = require("kanso/foo")
bar = require("kanso/bar")

to this:

foo = require("kanso").foo
bar = require("kanso").bar

Of course this adds this possible benefit:

var kanso = require("kanso"),
foo = kanso.foo,
bar = kanso.bar;

foo("This used to be kanso/foo!");
bar("This was kanso/bar")

kanso.util.puts("Hey, I didn't even have to specify it anymore!")