0.1.1 • Published 11 years ago

vine v0.1.1

Weekly downloads
398
License
-
Repository
-
Last release
11 years ago

Vine - JSON Message builder

What's this?

Just a small utility to help build consistent JSON messages, usually for API's.

Why?

Consistency. It's also cleaner, and easier to maintain.

Where should I use this?

- API
- nice replacement for callback(err, result);

Code Usage:

var vine = require('vine');


var data = vine.message('hello %s %s','craig','condon').

error('this is an error').

warning('this is a warning').

//time to cache this response
ttl(5).

//result data = success
result({data:'and this is some data'});


console.log(data.data); 

/* output:


	{ message: 'hello craig condon',
	  errors: [ { message: 'this is an error' } ],
	  warnings: [ { message: 'this is a warning' } ],
	  ttl: 5,
	  result: { data: 'and this is some data' } }
	
*/

To Do:

  • code != clean
0.1.1

11 years ago

0.1.0

11 years ago

0.0.14

12 years ago

0.0.13

12 years ago

0.0.12

12 years ago

0.0.11

12 years ago

0.0.10

12 years ago

0.0.9

13 years ago

0.0.8

13 years ago

0.0.7

13 years ago

0.0.6

13 years ago

0.0.5

13 years ago

0.0.1-2

13 years ago

0.0.1-1

13 years ago

0.0.1

13 years ago