Newman's Personal Motorcade

    @particle/untildify

    3.0.2 • Public • Published

    @particle/untildify

    Expand the ~ shortcut at the start of a path into the current user's $HOME directory

    Installation

    npm install @particle/untildify --save

    API

    @particle/untildify


    module.exports(pathStr) ⇒ string

    Expand ~ at the start of a path to an absolute path to the user's $HOME directory

    Kind: Exported function
    Returns: string - An absolute path to a location within the user's $HOME directory or the original path if ~ character is not found

    Param Type Description
    pathStr string Path string to operate on

    Example

    const pathToBashRc = untildify('~/.bashrc');
    console.log(pathToBashRc); // -> '/Users/me/.bashrc'

    NOTE: Unfortunately, docs have a nasty habit of falling out of date. When in doubt, check usage in tests

    Keywords

    none

    Install

    npm i @particle/untildify

    DownloadsWeekly Downloads

    73

    Version

    3.0.2

    License

    UNLICENSED

    Unpacked Size

    3.91 kB

    Total Files

    4

    Last publish

    Collaborators

    • amaury.particle
    • cole-abbeduto-particle
    • pedrosordo
    • rowan.hamilton
    • guohui
    • sbrust
    • busticated
    • particlebot
    • no1089
    • carlos.hdez
    • keeramis5
    • monkbroc
    • suda
    • mstan
    • sergeuz
    • debbie23
    • avtolstoy
    • mlauer
    • wraithan
    • toolboxbot
    • azenk
    • shewy
    • bwalach
    • parteberseth
    • rickkas7
    • mrlambchop_particle
    • hugo.montero
    • toddparticle
    • mphsi