My talk at HTML5DevConf && FluentConf covering how I combined some basic functional programming techniques with node.js streams to abstract a streaming VFS zipping layer that can also (theoretically / eventually) run in the browser.
We need…We need to recursively zip a directory… Let’s start with abstract implementation non-specific functional versions of… Filter paths from readdir Filter directories from paths Filter files from paths Recursively return all file paths in a directory
We need… More “abstract implementation non-specific functional versions” (errr…) of… ls (aka readdir) getFile (aka readFile) getFolder (stream of gets)
We need… Yet More AINSFV of... Zip a stream of files Allow node.js streams to be piped to lazy streams pipe(): lazy stream => node.js stream pump(): node.js stream => lazy stream
Say whaaat?node-browserify by @Substack does a lot of this already Stream, Buffer, Path, etc…We need… Complete buffer implementation (browser has TypedArrays & ArrayBuffer) fs (browser has FileSystem API) zlib… inflate(), deflate(), gzip(), gunzip(), unzip()
Stay Tuned.I’m currently porting the fs and buffer modules to the browser, and eventually zlib.http://github.com/crabdude/fs-browserifyhttp://github.com/crabdude/buffer-browserifyhttp://github.com/crabdude/zlib-browserify
We’re HIRING! webOS Framework TeamIf you think this is pretty cool… Or you think I’M pretty cool…Stop by the Enyo booth or talk to me afterwards.