if-exist

0.0.3 • Public • Published

Check if file or dir exists

Usage

Given that there is ./album.txt on the disk.

# Check if album.txt exists
if-exist ./album.txt && echo "album exists"

# Check if phone.txt does not exist
if-exist ./phone.txt || echo "phone does not exist"

# Create phone.txt if does not exist
if-exist -n ./phone.txt && echo "+12345" > phone.txt

/if-exist/

    Package Sidebar

    Install

    npm i if-exist

    Weekly Downloads

    145

    Version

    0.0.3

    License

    MIT

    Unpacked Size

    1.74 kB

    Total Files

    3

    Last publish

    Collaborators

    • igrek8