JSPM

relative-fs

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q9091F
  • License MIT

Wraps function from the fs module to make their path arguments relative to a another directory

Package Exports

  • relative-fs

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 (relative-fs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.