0.1.0 • Published 6 years ago

@brillout/relative-to-homedir v0.1.0

Weekly downloads
10
License
-
Repository
github
Last release
6 years ago

Make a path relative to the home directory

Usage Example

// /example.js

const relative_to_homedir = require('.');
const assert = require('assert');
const os = require('os');

const path = os.homedir()+'/path/to/something';

const path__relative_to_home_dir = relative_to_homedir(path);
console.log(path__relative_to_home_dir);
assert(path__relative_to_home_dir==='~/path/to/something');

Running /example.js will print ~/path/to/something