0.10.3 • Published 3 months ago

my-node-fp v0.10.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Simple node programming utility

ts Download Status Github Star Github Issues NPM version License code style: prettier

Simple utility functions that can use node.

Function list

fs

namedescription
existscheck file or directory exist, return boolean. exactly same depreciated fs.promise.exists funciton
existsSynccheck file or directory exist, return boolean. exactly same depreciated fs.existsSync funciton
getDirnameget directory name. If targetPath is already directory return targetPath(not parent directory)
getDirnameSyncget directory name. If targetPath is already directory return targetPath(not parent directory)
isDirectoryif targetPath is directory, return true
isDirectorySyncif targetPath is directory, return true
isEmptyDircheck directory is empty
isEmptyDirSynccheck directory is empty
isDescendantcheck target directory is descendant of parent directory

path

namedescription
basenamesReturn the last portion of a path, suffix can be string, string[]
replaceSepToPosixchange sep to posix.sep
replaceSepToWin32change sep to win32.sep
win32DriveLetterUpdownchange win32 drive letter (ex> c:) to upper or lower
startSepAppendstarts sep(or you can pass sep character) append if not start sep
endSepAppendends sep(or you can pass sep character) append if not end sep
startSepRemovestarts sep(or you can pass sep character) remove if start sep
endSepRemoveends sep(or you can pass sep character) remove if end sep