Feature: New VFS.File (shortcut) methods


Hi All,

Just wanted to let you know that it is now possible to do VFS operations via the VFS.File object. The new methods are just aliases, so they behave exactly the same – but some of you might find this a better way of writing things.

// Traditional
var file = new VFS.File('home:///foo.bar'); // Could also be a string
VFS.read(file, function(err, res) {
}, {type: 'text'});

// New helpers:
var file = new VFS.File('home:///foo.bar');
file.read(function(err, res) {
}, {type: 'text'});

// Or alternatively with the new constructor shortcut:
VFS.file('home:///foo.bar').read(function(err, res) {
}, {type: 'text'});

Have a great weekend! :slight_smile: