0.2.2 • Published 7 years ago

vifi v0.2.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Vifi - virtual file system library

examples:

// we're importing vifi libary
const vifi = require('vifi/2');

// we create virtual file system (and we inject fs module)
const vfs = vifi(require('fs'));

// then we open file:
const file = vfs.open('some-file.txt');

then if you want to use promises you write this way:

file.read().then(contents => {
    // notice - this is early version,
    // so now write only can replace content of file
    // appending is not implemented yet
    file.write(contents + '\n' + new Date)
});

or using async/await (Node 7+):

async function someFunction() {
    const contents = await file.read();
    file.write(contents + '\n' + new Date)
}

someFunction();
0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

8 years ago

0.0.4

8 years ago