Skip to content

Latest commit

 

History

History
70 lines (47 loc) · 1.09 KB

.verb.md

File metadata and controls

70 lines (47 loc) · 1.09 KB

{%= name %} {%= badge("fury") %}

{%= description %}

{%= include("install-npm", {save: true}) %}

Usage

var read = require('{%= name %}');

// async
read('foo.txt', function(err, buffer) {
  //=> <Buffer 74 68 69 73 20 69 73 20 66 6f 6f>
});

// sync
var buffer = read.sync('foo.txt');
//=> <Buffer 74 68 69 73 20 69 73 20 66 6f 6f>

BOM

if utf8 encoding is used, byte order marks will be stripped

async

read('foo.txt', 'utf8', function(err, buffer) {
  //=> 'some contents...'
});

// or
read('foo.txt', {encoding: 'utf8'} function(err, buffer) {
  //=> 'some contents...'
});

sync

read.sync('foo.txt', 'utf8');
// or
read('foo.txt', {encoding: 'utf8'});

options.normalize

Pass { normalize: true } on the options to strip windows carriage returns. This will also return a utf8 string.

Related projects

{%= related(verb.related.list) %}

Running tests

{%= include("tests") %}

Contributing

{%= include("contributing") %}

Author

{%= include("author") %}

License

{%= copyright() %} {%= license() %}


{%= include("footer") %}