@brillout/relative-to-homedir

0.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @brillout/relative-to-homedir

Weekly Downloads

1

Version

0.1.0

License

none

Unpacked Size

2.78 kB

Total Files

5

Last publish

Collaborators

  • brillout