Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

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.

Install

npm i relative-fs

DownloadsWeekly Downloads

3

Version

0.0.1

License

MIT

Last publish

Collaborators

  • avatar