enfsaddins
Additional methods for node fs module
enfs stands for [E]asy [N]ode [fs]
This module is intended to work as a sub-module of enfspatch
Description
This module will change some behaviors of fs module from node such as creating a queue for opening files when limit is reached, catching the error's and proceeding with the process when possible.
- This module will change the behaviour of:
- exists
- existsSync
Usage
enfsaddins
Valid usage but not the better:
var fs = ; var enfs = fs;
It's better to use
var enfs = ;
this will use enfspatch module that implements this module and allows access to all it's methods
Errors
All the methods follows the node culture.
- Async: Every async method returns an Error in the first callback parameter
- Sync: Every sync method throws an Error.
Additional Methods
- exists
- existsSync
- existAccess
- existAccessSync
- existStat
- existLStat
- existFStat
- existStatSync
- existLStatSync
- existFStatSync
- existStatIsDirectory
- existLStatIsDirectory
- existFStatIsDirectory
- existStatIsDirectorySync
- existLStatIsDirectorySync
- existFStatIsDirectorySync
- existStatIsFile
- existLStatIsFile
- existFStatIsFile
- existStatIsFileSync
- existLStatIsFileSync
- existFStatIsFileSync
- existIsSymlink
- existIsSymlinkSync
exists
- exists(path, callback)
Change the natural behaviour of fs.exists to the node culture, it will return an error in the first callback parameter. As exists is deprecated if it cease to exist then exists will use (#existStat) instead
Sync:
- existsSync(path)
enfs;
check: fs.exists
existAccess
- existAccess(path, [mode], callback)
Will use fs.access to check if the item exists in the file system and if the process as access to the item.
Sync:
- existAccessSync(path, [mode])
enfs;
check: fs.access
existStat
existLStat
- existStat(path,callback)
- existLStat(path,callback)
Will use fs.stat to check if the item exists in the file system.
Sync:
- existStatSync(path)
- existLStatSync(path)
enfs;
check: fs.stat
enfs;
check: fs.lstat
existFStat
- existFStat(fd,callback)
Will use fs.fstat to check if the item exists in the file system.
Sync:
- existFStatSync(path)
enfs;
check: fs.fstat
existStatIsDirectory
existLStatIsDirectory
existFStatIsDirectory
- existStatIsDirectory(path,callback)
- existLStatIsDirectory(path,callback)
- existFStatIsDirectory(path,callback)
Will use fs.stat or fs.lstat or fs.fstat to check if the item exists in the file system, and if it's a directory. This method is just a shortcut to check if an item exists in the file system and it's type
Sync:
- existStatIsDirectorySync(path)
- existLStatIsDirectorySync(path)
- existFStatIsDirectorySync(path)
enfs;
check: fs.stat fs.lstat fs.fstat
existStatIsFile
existLStatIsFile
existFStatIsFile
- existStatIsFile(path,callback)
- existLStatIsFile(path,callback)
- existFStatIsFile(path,callback)
Will use fs.stat or fs.lstat or fs.fstat to check if the item exists in the file system, and if it's a file. This method is just a shortcut to check if an item exists in the file system and it's type
Sync:
- existStatIsFileSync(path)
- existLStatIsFileSync(path)
- existFStatIsFileSync(path)
enfs;
check: fs.stat fs.lstat fs.fstat
existIsSymlink
- existIsSymlink(path,callback)
Will use fs.lstat to check if the item exists in the file system, and if it's a symbolic link. This method is just a shortcut to check if an item exists in the file system and it's type
Sync:
- existIsSymlinkSync(path)
enfs;
check: fs.lstat
License
Creative Commons Attribution 4.0 International License
Copyright (c) 2016 Joao Parreira joaofrparreira@gmail.com GitHub
This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit CCA4.