relative-fs

0.0.1 • Public • Published

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.

Package Sidebar

Install

npm i relative-fs

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • spalger