If you send the *"?fields="* query-string to a Google API, you'll get just 
the parts of the JSON object from the response that you requested.

Now, you can have this same exact feature in your Node.js services. Say 
hello to *JSON Mask <https://github.com/nemtsov/json-mask>* and the *Partial 
Response Middleware <https://github.com/nemtsov/partial-response-middleware>
* for express!

*JSON Mask* is a tiny language and an engine for selecting specific parts 
of a JS object, hiding/masking the rest. Here's a tiny sample of what it 
looks like:

var mask = require('json-mask')mask({p: {a: 1, b: 2}, z: 1}, 'p/a,z')  // {p: 
{a: 1}, z: 1}

*Partial Response Middleware* is an express middleware that will integrate 
with your existing services with no additional code if you're using* 
res.json() or res.jsonp()* So, instead of getting the entire JSON object, 
your services will start being able to respond with partial objects.


I'd love to hear what you think about these.

- Yuriy

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to