"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/fs-plus/README.md" (7 Feb 2017, 7716 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

fs plus

OS X Build Status Windows Build Status Dependency Status

Yet another filesystem helper based on node's fs module. This library exports everything from node's fs module but with some extra helpers.

Using

npm install fs-plus
fs = require 'fs-plus'

Documentation

getHomeDirectory()

Returns the absolute path to the home directory.

absolute(relativePath)

Make the given path absolute by resolving it against the current working directory.

Params

Return

normalize(pathToNormalize)

Normalize the given path treating a leading ~ segment as referring to the home directory. This method does not query the filesystem.

Params

Return

tildify(pathToTildify)

Convert an absolute path to tilde path for linux and mac: /Users/username/dev => ~/dev

Params

Return

getAppDataDirectory()

Get path to store application specific data.

Return

isAbsolute(pathToCheck)

Is the given path absolute?

Params

Return

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.

Params

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.

Params

Return

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.

Params

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.

Params

Return

resolve(loadPaths, pathToResolve, extensions)

Finds a relative path among the given array of paths.

Params

Return

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.

Params

Return

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.