dfilatov / vow-fs

Vow-based file I/O for Node.js
MIT License
28 stars 8 forks source link

Default encoding #15

Closed watch-the-stars closed 10 years ago

watch-the-stars commented 10 years ago

Documentation says that for reading/writing operations encoding defaults to utf8. But in the following example file contents is still buffer:

var vowFs = require('vow-fs');
var resolve = require('path').resolve;

vowFs.read(resolve(__dirname, 'text.txt')).then(function(content) {
    console.log(content instanceof Buffer); // true
});

Whereas

vowFs.read(resolve(__dirname, 'text.txt'), {encoding: 'utf8'}).then(function(content) {
    console.log(content instanceof Buffer); // false
});

Is it expected behavior? )

dfilatov commented 10 years ago

Documentation was wrong, sorry (