@jamesarlow/tilde-path

0.0.3 • Public • Published

tilde-path

Node Path with support for leading tilde home strings

Overview

Developers and users shouldn't have to overthink whether tilde strings are supported in a given context.

This module patches the original path module so that leading tilde strings are handled by resolve and normalize.

Installation

npm install @jamesarlow/tilde-path

Usage

const path = require('tilde-path')

path.resolve('~')
// == os.homedir()

path.resolve('~', 'Documents')
// == os.homedir() + '/Documents'

path.resolve('~/Pictures')
// == os.homedir() + '/Pictures'

/@jamesarlow/tilde-path/

    Package Sidebar

    Install

    npm i @jamesarlow/tilde-path

    Weekly Downloads

    0

    Version

    0.0.3

    License

    ISC

    Last publish

    Collaborators

    • jamesarlow