0.0.1 • Published 10 years ago

relative-fs v0.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
10 years ago

relative-fs

An NPM module that can wrap the fs module to make it's path arguments relative to the current directory.

Turns this:

var path = require('path');
var fs = require('fs');

var file = fs.readFileSync(path.join(__dirname, './some-file'));

Into this:

var fs = require('relative-fs').relativeTo(__dirname);
var file = fs.readFileSync('./some-file');

The plugin is very straight-forward and does exactly what you would think in just a few lines of code.