iriscouch/kanso — comment on commit 0788d7a8df7d52be06b86fb8dd22049ea2c6a10e
File: scripts/kanso.js line 7
By jhs:

Right. Here I am bumping into my ignorance of Kanso. Are these packages completely separate "things" (having trouble using unambiguous wording) from this project? Are they in different Git repositories for example?

Can I run `require("kanso/logger")` from Couch or from the web app, or is this purely Node stuff?

NPM makes it so that you can say `require("kanso")` and you get the Kanso package you expect. In fact, you can have different parts of your program depend on different releases of Kanso, and NPM ensures they each get the version they need from their require calls. I am hoping to take advantage of that eventually.

The next problem is `require("kanso/foo")`. In Node, that means, "From the package called 'kanso' which I specified in package.json, please import 'foo.js' from its top-level directory." So this could work immediately by moving `src/kanso/*` to the top-level. However I don't like that.

At this time, in Node, `require("kanso")` is broken. The `package.json` "main" entry points to a missing file. Maybe we could fix both of these issues. What if the API looked like this instead?

```javascript
var path = require('path'),
utils = require('kanso').utils,
kansorc = require('kanso').kansorc,
commands = require('kanso').commands;
```

That would be implemented by pointing package.json's "main" field to the primary public API of Kanso, which exports the modules in a straightforward way. I will submit a pull request to show what I mean but I'm not sure if it will work.