shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
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
- path*-String
The file path to get folder path from
- checkExistencefalseBoolean
Specify if you want to check the file existence before
Return
- -String
The folder path or ” if not exists
Example
import { folderPath } from '@blackbyte/sugar/fs';
folderPath('my/cool/path.js'); // => 'my/cool'Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space