Gathering detailed insights and metrics for fs-plus
Gathering detailed insights and metrics for fs-plus
npm install fs-plus
Typescript
Module System
Node Version
NPM Version
96.9
Supply Chain
99.1
Quality
81.6
Maintenance
100
Vulnerability
98.6
License
CoffeeScript (53.58%)
JavaScript (46.42%)
Total Downloads
32,926,982
Last Day
9,009
Last Week
38,295
Last Month
169,889
Last Year
1,969,136
107 Stars
288 Commits
35 Forks
15 Watching
11 Branches
34 Contributors
Minified
Minified + Gzipped
Latest Version
3.1.1
Package Id
fs-plus@3.1.1
Size
7.90 kB
NPM Version
6.4.1
Node Version
8.14.0
Publised On
19 Dec 2018
Cumulative downloads
Total Downloads
Last day
-7.5%
9,009
Compared to previous day
Last week
-18.5%
38,295
Compared to previous week
Last month
9.3%
169,889
Compared to previous month
Last year
-21%
1,969,136
Compared to previous year
4
Yet another filesystem helper based on node's fs module. This library exports everything from node's fs module but with some extra helpers.
1npm install fs-plus
1fs = require 'fs-plus'
getHomeDirectory()
Returns the absolute path to the home directory.
absolute(relativePath)
Make the given path absolute by resolving it against the current working directory.
relativePath
: The string representing the relative path. If the
path is prefixed with '~', it will be expanded to the current user's home
directory.normalize(pathToNormalize)
Normalize the given path treating a leading ~
segment as referring to the
home directory. This method does not query the filesystem.
pathToNormalize
: The string containing the abnormal path. If the
path is prefixed with '~', it will be expanded to the current user's home
directory.tildify(pathToTildify)
Convert an absolute path to tilde path on Linux and macOS: /Users/username/dev => ~/dev
pathToTildify
: The string containing the full path.getAppDataDirectory()
Get path to store application specific data.
String Returns the absolute path or null if platform isn't supported
~/Library/Application Support/
%AppData%
/var/lib
isAbsolute(pathToCheck)
Is the given path absolute?
pathToCheck
: The relative or absolute path to check.true
if the path is absolute, false
otherwise.existsSync(pathToCheck)
Returns true
if a file or folder at the specified path exists.
isDirectorySync(directoryPath)
Returns true
if the given path exists and is a directory.
isDirectory(directoryPath)
Asynchronously checks that the given path exists and is a directory.
isFileSync(filePath)
Returns true if the specified path exists and is a file.
isSymbolicLinkSync(symlinkPath)
Returns true
if the specified path is a symbolic link.
isSymbolicLink(symlinkPath, callback)
Calls back with true
if the specified path is a symbolic link.
isExecutableSync(pathToCheck)
Returns true
if the specified path is executable.
getSizeSync(pathToCheck)
Returns the size of the specified path.
listSync(rootPath, extensions)
Returns an Array with the paths of the files and directories contained within the directory path. It is not recursive.
rootPath
: The absolute path to the directory to list.extensions
: An array of extensions to filter the results by. If none are
given, none are filtered (optional).list(rootPath, extensions)
Asynchronously lists the files and directories in the given path. The listing is not recursive.
listTreeSync(rootPath)
Get all paths under the given path.
rootPath
The {String} path to start at.moveSync(source, target)
Moves the file or directory to the target synchronously.
removeSync(pathToRemove)
Removes the file or directory at the given path synchronously.
writeFileSync(filePath, content, options)
Open, write, flush, and close a file, writing the given content synchronously. It also creates the necessary parent directories.
writeFile(filePath, content, options, callback)
Open, write, flush, and close a file, writing the given content asynchronously. It also creates the necessary parent directories.
copySync(sourcePath, destinationPath)
Copies the given path recursively and synchronously.
makeTreeSync(directoryPath)
Create a directory at the specified path including any missing parent directories synchronously.
makeTree(directoryPath, callback)
Create a directory at the specified path including any missing parent directories asynchronously.
traverseTreeSync(rootPath, onFile, onDirectory)
Recursively walk the given path and execute the given functions synchronously.
rootPath
: The string containing the directory to recurse into.onFile
: The function to execute on each file, receives a single argument
the absolute path.onDirectory
: The function to execute on each directory, receives a single
argument the absolute path (defaults to onFile). If this
function returns a falsy value then the directory is not
entered.traverseTree(rootPath, onFile, onDirectory, onDone)
Public: Recursively walk the given path and execute the given functions asynchronously.
md5ForPath(pathToDigest)
Hashes the contents of the given file.
pathToDigest
: The string containing the absolute path.resolve(loadPaths, pathToResolve, extensions)
Finds a relative path among the given array of paths.
loadPaths
: An array of absolute and relative paths to search.pathToResolve
The string containing the path to resolve.extensions
An array of extensions to pass to {resolveExtensions} in
which case pathToResolve should not contain an extension
(optional).Returns the absolute path of the file to be resolved if it's found and undefined otherwise.
resolveOnLoadPath()
Like .resolve
but uses node's modules paths as the load paths to
search.
resolveExtension(pathToResolve, extensions)
Finds the first file in the given path which matches the extension in the order given.
pathToResolve
: the string containing relative or absolute path of the
file in question without the extension or '.'.extensions
: the ordered array of extensions to try.Returns the absolute path of the file if it exists with any of the given extensions, otherwise it's undefined.
isCompressedExtension(ext)
Returns true for extensions associated with compressed files.
isImageExtension(ext)
Returns true for extensions associated with image files.
isPdfExtension(ext)
Returns true for extensions associated with pdf files.
isBinaryExtension(ext)
Returns true for extensions associated with binary files.
isReadmePath(readmePath)
Returns true for files named similarily to 'README'
isMarkdownExtension(ext)
Returns true for extensions associated with Markdown files.
isCaseInsensitive()
Is the filesystem case insensitive?
Returns true
if case insensitive, false
otherwise.
isCaseSensitive()
Is the filesystem case sensitive?
Returns true
if case sensitive, false
otherwise.
statSyncNoException(path[, options])
Calls fs.statSync
, catching all exceptions raised. This method calls fs.statSyncNoException
when provided by the underlying fs
module (Electron < 3.0).
Returns fs.Stats
if the file exists, false
otherwise.
lstatSyncNoException(path[, options])
Calls fs.lstatSync
, catching all exceptions raised. This method calls fs.lstatSyncNoException
when provided by the underlying fs
module (Electron < 3.0).
Returns fs.Stats
if the file exists, false
otherwise.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
Found 1/3 approved changesets -- score normalized to 3
Reason
project is archived
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
27 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More