Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
HTTP API document generator
JavaScript
tag: v0.0.4

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
test
.gitignore
README.md
index.js
package.json

README.md

bees (in Italian API means bees)

Let the code write your docs D:

Installation:

$ npm install bees

Example:

app.js

var app = require('express').createServer();


/**
 * GET /
 * 
 * @return Main page
*/
app.get('/', function(req, res){
    res.send('Hello World');
});

/**
 * GET /:id
 * 
 * @param id id of the user
 * @return user infos
*/
app.get('/:id', function(req, res){
    res.send('Hello World');
});


app.listen(3000);
$ bees app.js
[
  {
    "method":"GET",
    "path":"/",
    "return":"Main page"
  },
  {
    "method":"GET",
    "path":"/:id",
    "params":{
      "id":"id of the user"
    },
    "return":"user infos"
  }
]

Plugin:

You can extend Bees and add new keywords with a tiny plugin system (see lib/plugins)

var bees = require('bees');
bees.use('plugin', function(cmd, json) {
  json.plugin = cmd[1];
});
console.log(
  bees.parse(
    require('fs').readFileSync('./app.js','utf-8')
  )
);

Now you can use it

/**
 * GET /:id
 * 
 * @param id id of the user
 * @return user infos
 * @plugin hai lol
*/
$ node plugin.js

To Do:

  • Generate HTML from JSON

Tests:

$ npm test

Tests are written with Vows

License:

MIT

Something went wrong with that request. Please try again.