folderPath

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

This function returns you the folder path of the file path passed. You can tell the function to check for file existence before getting the folder path with the second parameter.

Params

  1. path*-String

    The file path to get folder path from

  2. checkExistencefalseBoolean

    Specify if you want to check the file existence before

Return

  1. -String

    The folder path or ” if not exists

Example

import { folderPath } from '@blackbyte/sugar/fs';
folderPath('my/cool/path.js'); // => 'my/cool'

Todo

  • testsnormal