1.0.5 • Published 12 years ago
read-mapped-file v1.0.5
read-mapped-file
Read a file and its associated source map.
Usage
var readMappedFile = require('read-mapped-file');
var file = readMappedFile({
src: 'test.js',
cwd: 'example'
});
console.log(file.code);
console.log(file.map);Method
readMappedFile(options, [callback]);- options
Object- src
StringSource file path. - cwd
StringCurrent working directory. - mapSrc
StringMap file path. - mapDir
StringMap file root directory. - fs
Object|StringOptions to pass tofs.readFile. - code
StringSource code. If set,srcis ignored. - map
JSONSource map. If set,mapSrcis ignored.
- src
- callback
FunctionErrback(err, data)
If callback is passed then the file read will be asynchronous. Callbacks are
passed (err, data), where data is an object literal:
{
code: String,
map: Object,
cwd: String,
src: String,
mapSrc: String
}
