JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 105
  • Score
    100M100P100Q7366F
  • License MIT

graceful-fs / fs-extra promise wrapper with goodies

Package Exports

  • @absolunet/fsp

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@absolunet/fsp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@absolunet/fsp

npm npm dependencies npms Travis CI Code style

graceful-fs / fs-extra promise wrapper with goodies

Install

$ npm install @absolunet/fsp

Usage

const fsp = require('@absolunet/fsp');

fsp.chmodPattern('/path1/path2/**/*.js', 0o775).then(() => {
    console.log('Yeah!');
});

API

fs is graceful-fs

fse is fs-extra

access

Maps fs.promises.access

appendFile

Maps fs.promises.appendFile

chmod

Maps fs.promises.chmod

chmodPattern(pattern, mode [, options])

Applies fs.chmod for matching glob pattern file/dir.

pattern

Required
Type: String
glob pattern.

mode

Required
Type: Number
File mode.

options

Type: Object
glob options.

chown

Maps fs.promises.chown

compressFile(source [, destination])

Compresses file using gzip Promise returns destination

source

Required
Type: String
Path of file to compress.

destination

Type: String
Default: Same as source with a .gz added at the end
Path of file when compressed.

copy

Maps fse.copy

copyFile

Maps fs.promises.copyFile

decompressFile(source [, destination])

Decompresses file using gzip Promise returns destination

source

Required
Type: String
Path of file to decompress.

destination

Type: String
Default: Same as source with the .gz removed at the end
Path of file when decompressed.

emptyDir

Maps fse.emptyDir

ensureDir

Maps fse.ensureDir

ensureFile

Maps fse.ensureFile

Maps fse.ensureLink

Maps fse.ensureSymlink

lchmod

Maps fs.promises.lchmod

lchown

Maps fs.promises.lchown

Maps fs.promises.link

lstat

Maps fs.promises.lstat

mergeFiles(sources, destination)

Merge multiple files into a single file

sources

Required
Type: Array of String
Path of files to merge.

destination

Required
Type: String
Path of merged file. (If it ends with .gz it will be compressed using gzip)

mkdir

Maps fs.promises.mkdir

mkdirp

Maps fse.mkdirp

mkdirs

Maps fse.mkdirs

mkdtemp

Maps fs.promises.mkdtemp

move

Maps fse.move

open

Maps fs.promises.open

outputCompressed(file, content)

Almost the same as writeCompressed, except that if the directory does not exist, it's created.

file

Required
Type: String
Path of file to write.

content

Required
Type: String
Content to write.

outputFile

Maps fse.outputFile

outputJson(file, object [, options])

Almost the same as writeJson, except that if the directory does not exist, it's created.

file

Required
Type: String
Path of file to write. (If it ends with .gz it will be compressed using gzip)

object

Required
Type: Object
Object to write.

options.replacer

Type: Function
JSON.stringify replacer.

options.space

Type: String or Number
JSON.stringify space.

outputXml(file, object [, options])

Almost the same as writeXml, except that if the directory does not exist, it's created.

file

Required
Type: String
Path of file to write. (If it ends with .gz it will be compressed using gzip)

object

Required
Type: Object
Object to write.

options

Type: Object
xml2js.Builder().buildObject options.

outputYaml(file, object)

Almost the same as writeYaml, except that if the directory does not exist, it's created.

file

Required
Type: String
Path of file to write. (If it ends with .gz it will be compressed using gzip)

object

Required
Type: Object
Object to write.

pathExists

Maps fse.pathExists

readCompressed(file)

Reads and decompresses file using gzip. Promise returns an String

file

Required
Type: String
Path of file to read.

readdir

Maps fs.promises.readdir

readFile

Maps fs.promises.readFile

readJson(file [, reviver])

Reads a JSON file and then parses it into an object.
Promise returns an Object

file

Required
Type: String
Path of file to read. (If it ends with .gz it will be decompressed using gzip)

reviver

Type: Function
JSON.parse reviver.

Maps fs.promises.readlink

readXml(file [, options])

Reads a XML file and then parses it into an object.
Promise returns an Object

file

Required
Type: String
Path of file to read. (If it ends with .gz it will be decompressed using gzip)

options

Type: Object
xml2js.parseString options.

readYaml(file)

Reads a YAML file and then parses it into an object.
Promise returns an Object

file

Required
Type: String
Path of file to read. (If it ends with .gz it will be decompressed using gzip)

realpath

Maps fs.promises.realpath

remove

Maps fse.remove

rename

Maps fs.promises.rename

rmdir

Maps fs.promises.rmdir

stat

Maps fs.promises.stat

Maps fs.promises.symlink

truncate

Maps fs.promises.truncate

Maps fs.promises.unlink

utimes

Maps fs.promises.utimes

writeCompressed(file, content)

Compresses and writes content to file using gzip.

file

Required
Type: String
Path of file to write.

content

Required
Type: String
Content to write.

writeFile

Maps fs.promises.writeFile

writeJson(file, content [, options])

Writes an object to a JSON file.

file

Required
Type: String
Path of file to write. (If it ends with .gz it will be compressed using gzip)

object

Required
Type: Object
Object to write.

options.replacer

Type: Function
JSON.stringify replacer.

options.space

Type: String or Number
JSON.stringify space.

writeXml(file, content [, options])

Writes an object to a XML file.

file

Required
Type: String
Path of file to write. (If it ends with .gz it will be compressed using gzip)

object

Required
Type: Object
Object to write.

options

Type: Object
xml2js.Builder().buildObject options.

writeYaml(file, object)

Writes an object to a YAML file.

file

Required
Type: String
Path of file to write. (If it ends with .gz it will be compressed using gzip)

object

Required
Type: Object
Object to write.

License

MIT © Absolunet