Package Exports
- read-file
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (read-file) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
read-file 
Lightweight methods for reading from the file system, async and sync, with extras for stripping byte order marks and normalizing newlines.
Install
Install with npm:
npm i read-file --save-dev
api
readFile
Read files asynchronously.
var file = require('read-file');
file.readFileSync('foo.txt');
readFileSync
Read files synchronously.
var file = require('read-file');
file.readFile('foo.txt', callback);
encoding
Default encoding is utf8
, this can be changed by passing an encoding as a second param:
var file = require('read-file');
file.readFileSync('foo.txt', 'utf8');
// or
file.readFile('foo.txt', 'utf8', callback);
normalizeNL
Normalize all line endings to newlines, \n
.
var file = require('read-file');
var str = file.readFileSync('foo.txt');
file.normalizeNL(str);
stripBOM
Strip byte order marks.
var file = require('read-file');
var str = file.readFileSync('foo.txt');
file.stripBOM(str);
Authors
Jon Schlinkert
Brian Woodward
License
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
This file was generated by verb-cli on April 09, 2014.