JSPM

@jamesarlow/tilde-path

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q34974F
  • License ISC

`Path` upgraded to support resolve/normalize user home path strings.

Package Exports

  • @jamesarlow/tilde-path

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

Readme

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'