0.0.1 • Published 10 years ago

ubuilder v0.0.1

Weekly downloads
6
License
-
Repository
github
Last release
10 years ago

ubuilder

Simple lib to help you build paths for some DSL code:

e.g:

ubuilder = require 'ubuilder'

ubuilder.add({path: 'project', id: 1})
  .add({path: 'tasks', 'rules': [{need: 'projects'}]})
  .build() #/project/1/tasks.json

This will allow you to create codes like:

teamwork.project(1).tasks().get (err, response, body) ->
  console.log body

class Teamwork
  project: (id) ->
    ubuilder.add({path: 'project', id: 1});
  tasks: ->
    ubuilder.add({path: 'tasks', rules: [{need: 'project'}]})
    
  get: (callback) ->
    request(ubuilder.build(), callback)

License

Licensed under The MIT License Redistributions of files must retain the above copyright notice.

Author

Vinícius Krolow - krolowatgmail.com