Re: [nodejs] Re: Good examples on how to create a library that aggregates REST api's ?

2014-12-26 Thread Simon Ho
Hi Justin, Have a look at the LoopBack source code for a good example of a larger project setup. As for REST APIs, this is the perfect use case for actually using LoopBack. You can simply create your models with a few commands

Re: [nodejs] Re: Good examples on how to create a library that aggregates REST api's ?

2014-12-26 Thread Justin Maat
Thanks Simon. I'm vaguely familiar with LoopBack but I'll have to read a bit more. This looks better for creating an actual REST api, which I'm not really trying to do. I'm attempting to wrap existing Rest api's into some common node module. Actually the response from Adrien referencing th

Re: [nodejs] Re: Good examples on how to create a library that aggregates REST api's ?

2014-12-26 Thread Simon Ho
No problem. Another interesting point to note is that LoopBack provides a REST connector that allows you to do just that (for LoopBack based projects). Basically, it allows you to map REST endpoints to a LoopBack project, which you can use

[nodejs] Very simple question re:Buffers...

2014-12-26 Thread // ravi
Howdy all, please tell me what I am missing here. The doc (http://nodejs.org/api/buffer.html#buffer_buf_slice_start_end) for Buffer#slice says: = buf.slice([start], [end]) • start Number, Optional, Default: 0 • end Number, Optional, Default: buffer.length Returns a new buffer which

[nodejs] Re: Very simple question re:Buffers...

2014-12-26 Thread Thomas Shinnick
The use and definition of 'end' is likely to be the same as for TypedArray.subarray(start,end) or Array.slice(start,end)

[nodejs] Re: Very simple question re:Buffers...

2014-12-26 Thread mscdex
On Friday, December 26, 2014 11:15:50 PM UTC-5, // ravi wrote: > > Given that offsets are 0-indexed and [end] is the end offset, shouldn’t > that default to buffer.length - 1? Digging through node/lib/buffer.js to > smalloc, I see: > > `end` is the ending offset (not inclusive). P.S: given that