/ piacw.com / dev / pias-backend-2 / node_modules / @npmcli / fs /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]lib/2 years ago -  
[TXT]LICENSE.md40 years ago798 0fb859dc fixed mobile overflwo options [كارل مبارك]
[TXT]README.md40 years ago1.9K0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]package.json2 years ago1.7K 
README.md

@npmcli/fs

polyfills, and extensions, of the core fs module.

Features

The owner option

The copyFile, mkdir, mkdtemp, writeFile, and withTempDir functions all accept a new owner property in their options. It can be used in two ways:

The special string 'inherit' may be passed instead of a number, which will cause this module to automatically determine the correct uid and/or gid from the nearest existing parent directory of the target.

fs.withTempDir(root, fn, options) -> Promise

Parameters

Usage

The withTempDir function creates a temporary directory, runs the provided function (fn), then removes the temporary directory and resolves or rejects based on the result of fn.

const fs = require('@npmcli/fs')
const os = require('os')

// this function will be called with the full path to the temporary directory
// it is called with `await` behind the scenes, so can be async if desired.
const myFunction = async (tempPath) => {
  return 'done!'
}

const main = async () => {
  const result = await fs.withTempDir(os.tmpdir(), myFunction)
  // result === 'done!'
}

main()
Apache/2.4.38 (Debian) Server at www.karls.computer Port 80