diff options
author | Nevena Bojovic <nenabojov@gmail.com> | 2022-03-01 22:05:25 +0100 |
---|---|---|
committer | Nevena Bojovic <nenabojov@gmail.com> | 2022-03-01 22:05:25 +0100 |
commit | 6555fb80fdd8f6a5d201efadec3189d1244830a0 (patch) | |
tree | c1aa1c5aedc634ad1ea7fad4847884d559b51290 /sandbox/testAppNevena/Front/node_modules/@npmcli/fs/README.md | |
parent | 7d3640f824f46490b47bd95f1c5a16644f712068 (diff) |
Izbrisala bin, obj i node-modules.
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/@npmcli/fs/README.md')
-rw-r--r-- | sandbox/testAppNevena/Front/node_modules/@npmcli/fs/README.md | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/@npmcli/fs/README.md b/sandbox/testAppNevena/Front/node_modules/@npmcli/fs/README.md deleted file mode 100644 index bc71a119..00000000 --- a/sandbox/testAppNevena/Front/node_modules/@npmcli/fs/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# @npmcli/fs - -polyfills, and extensions, of the core `fs` module. - -## Features - -- all exposed functions return promises -- `fs.rm` polyfill for node versions < 14.14.0 -- `fs.mkdir` polyfill adding support for the `recursive` and `force` options in node versions < 10.12.0 -- `fs.copyFile` extended to accept an `owner` option -- `fs.mkdir` extended to accept an `owner` option -- `fs.mkdtemp` extended to accept an `owner` option -- `fs.writeFile` extended to accept an `owner` option -- `fs.withTempDir` added -- `fs.cp` polyfill for node < 16.7.0 - -## 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: - -- `{ owner: { uid: 100, gid: 100 } }` - set the `uid` and `gid` explicitly -- `{ owner: 100 }` - use one value, will set both `uid` and `gid` the same - -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 - -- `root`: the directory in which to create the temporary directory -- `fn`: a function that will be called with the path to the temporary directory -- `options` - - `tmpPrefix`: a prefix to be used in the generated directory name - -### 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`. - -```js -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() -``` |