fproxy
==========
generic javascript functional lazy proxy abstraction
Functional generic lazy proxy, provides functions to access stored values, arguments, objects, files or documents.
examples
//using local file system text file reader with watcher sync/assync modesvar fProxy=;var textFile=;var text=;;//get updated & parsed document//do some external changes to the text file;//get updated & parsed documentconsole;//get file content in sync mode (no callback provided);//assync mode
//es6 promises using node-swearvar swear=;var fProxy=;var textFile=;var text=;;
fproxy must be initialized with a media descriptor. The media descriptor has the option to be sync or assync, the resulting access function can be then turned into a promise with node-swear.
A set o media descriptors is available at:
require("fproxy").mediaDescriptors
media descriptors are ES6 classes
mem: Mem, memory storage of single values args: Params, storing passed params obj: Obj, creates new objects where parser is then a constructor file: File, sync/assync file system (use node-swear for ES6 promises)
media descriptor#
a media descriptor is a class with:
constructor: define parser
load: sync/assync read and parse the data with specific implementation parameters
inocuous#
- result document is not polluted with any property of this module.
- client receives no information/access about other proxy items.