npm.io
0.1.1 • Published 12 years ago

transients

Licence
MIT
Version
0.1.1
Deps
1
Vulns
2
Weekly
0

#JSON Transients

This plugin wraps the request module with a cache layer. Inspired by the WordPress Transients API.

setTransient

setTransient( name, url, cacheFor )

Returns false if the JSON request fails.

getTransient

Creates a transient object.

getTransient( name, callback( data ) [optional] )

Retrieves a transient object, makes a new request if the old on has expired, else returns cached Object.

Returns the transients data if no callback is provided.

Returns false if the transient was never set.

Keywords