https://github.com/krolow/ubuilder
Lib to help create DSL for URL paths
https://github.com/krolow/ubuilder
Last synced: 2 months ago
JSON representation
Lib to help create DSL for URL paths
- Host: GitHub
- URL: https://github.com/krolow/ubuilder
- Owner: krolow
- License: mit
- Created: 2014-10-27T18:23:19.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-29T00:17:06.000Z (over 10 years ago)
- Last Synced: 2024-04-27T04:03:37.986Z (about 1 year ago)
- Language: CoffeeScript
- Size: 129 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ubuilder
===========Simple lib to help you build paths for some DSL code:
e.g:
```coffee
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:**
```coffee
teamwork.project(1).tasks().get (err, response, body) ->
console.log bodyclass 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 - krolow[at]gmail.com