grabFirstExistingSync

Type:Function
Status:stable
Since:1.0.0
Platform:node
@blackbyte.sugar.node.fs

Check every passed paths and return the first existing one.

Params

  1. paths*-String[]

    The paths to check

Return

  1. -String

    The first existing path

Example

import { grabFirstExistingSync } from '@blackbyte/sugar/fs';
grabFirstExistingSync([
 'file/1.txt',
 'file/2.txt'
]); // => 'file/2.txt'

Todo

  • testsnormal