From a5389c87384fa2000daea30523a2fc5ba9448a37 Mon Sep 17 00:00:00 2001 From: bakustarver <66978329+bakustarver@users.noreply.github.com> Date: Mon, 1 Jul 2024 20:40:59 +0300 Subject: [PATCH] Add files via upload --- .../node_modules/fs-extra/docs/copy-sync.md | 37 +++++++++ .../node_modules/fs-extra/docs/copy.md | 68 ++++++++++++++++ .../fs-extra/docs/emptyDir-sync.md | 16 ++++ .../node_modules/fs-extra/docs/emptyDir.md | 43 ++++++++++ .../fs-extra/docs/ensureDir-sync.md | 32 ++++++++ .../node_modules/fs-extra/docs/ensureDir.md | 76 ++++++++++++++++++ .../fs-extra/docs/ensureFile-sync.md | 17 ++++ .../node_modules/fs-extra/docs/ensureFile.md | 44 +++++++++++ .../fs-extra/docs/ensureLink-sync.md | 19 +++++ .../node_modules/fs-extra/docs/ensureLink.md | 46 +++++++++++ .../fs-extra/docs/ensureSymlink-sync.md | 20 +++++ .../fs-extra/docs/ensureSymlink.md | 47 +++++++++++ .../fs-extra/docs/fs-read-write-writev.md | 48 +++++++++++ .../node_modules/fs-extra/docs/move-sync.md | 24 ++++++ .../node_modules/fs-extra/docs/move.md | 57 +++++++++++++ .../fs-extra/docs/outputFile-sync.md | 19 +++++ .../node_modules/fs-extra/docs/outputFile.md | 52 ++++++++++++ .../fs-extra/docs/outputJson-sync.md | 25 ++++++ .../node_modules/fs-extra/docs/outputJson.md | 58 ++++++++++++++ .../fs-extra/docs/pathExists-sync.md | 3 + .../node_modules/fs-extra/docs/pathExists.md | 35 ++++++++ .../fs-extra/docs/readJson-sync.md | 32 ++++++++ .../node_modules/fs-extra/docs/readJson.md | 79 +++++++++++++++++++ .../node_modules/fs-extra/docs/remove-sync.md | 16 ++++ .../node_modules/fs-extra/docs/remove.md | 46 +++++++++++ .../fs-extra/docs/writeJson-sync.md | 24 ++++++ .../node_modules/fs-extra/docs/writeJson.md | 52 ++++++++++++ .../node_modules/fs-extra/test/readme.md | 1 + 28 files changed, 1036 insertions(+) create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/copy-sync.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/copy.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/emptyDir-sync.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/emptyDir.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureDir-sync.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureDir.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureFile-sync.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureFile.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureLink-sync.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureLink.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureSymlink-sync.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureSymlink.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/fs-read-write-writev.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/move-sync.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/move.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputFile-sync.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputFile.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputJson-sync.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputJson.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/pathExists-sync.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/pathExists.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/readJson-sync.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/readJson.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/remove-sync.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/remove.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/writeJson-sync.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/writeJson.md create mode 100644 nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/test/readme.md diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/copy-sync.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/copy-sync.md new file mode 100644 index 0000000..2ccfe3d --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/copy-sync.md @@ -0,0 +1,37 @@ +# copySync(src, dest[, options]) + +Copy a file or directory. The directory can have contents. + +- `src` `` Note that if `src` is a directory it will copy everything inside of this directory, not the entire directory itself (see [issue #537](https://github.com/jprichardson/node-fs-extra/issues/537)). +- `dest` `` Note that if `src` is a file, `dest` cannot be a directory (see [issue #323](https://github.com/jprichardson/node-fs-extra/issues/323)). +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior. + - `errorOnExist` ``: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`. + - `dereference` ``: dereference symlinks, default is `false`. + - `preserveTimestamps` ``: When true, will set last modification and access times to the ones of the original source files. When false, timestamp behavior is OS-dependent. Default is `false`. + - `filter` ``: Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it. + +## Example: + +```js +const fs = require('fs-extra') + +// copy file +fs.copySync('/tmp/myfile', '/tmp/mynewfile') + +// copy directory, even if it has subdirectories or files +fs.copySync('/tmp/mydir', '/tmp/mynewdir') +``` + +**Using filter function** + +```js +const fs = require('fs-extra') + +const filterFunc = (src, dest) => { + // your logic here + // it will be copied if return true +} + +fs.copySync('/tmp/mydir', '/tmp/mynewdir', { filter: filterFunc }) +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/copy.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/copy.md new file mode 100644 index 0000000..f6e4d98 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/copy.md @@ -0,0 +1,68 @@ +# copy(src, dest[, options][, callback]) + +Copy a file or directory. The directory can have contents. + +- `src` `` Note that if `src` is a directory it will copy everything inside of this directory, not the entire directory itself (see [issue #537](https://github.com/jprichardson/node-fs-extra/issues/537)). +- `dest` `` Note that if `src` is a file, `dest` cannot be a directory (see [issue #323](https://github.com/jprichardson/node-fs-extra/issues/323)). +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior. + - `errorOnExist` ``: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`. + - `dereference` ``: dereference symlinks, default is `false`. + - `preserveTimestamps` ``: When true, will set last modification and access times to the ones of the original source files. When false, timestamp behavior is OS-dependent. Default is `false`. + - `filter` ``: Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it. Can also return a `Promise` that resolves to `true` or `false` (or pass in an `async` function). +- `callback` `` + - `err` `` + +## Example: + +```js +const fs = require('fs-extra') + +// With a callback: +fs.copy('/tmp/myfile', '/tmp/mynewfile', err => { + if (err) return console.error(err) + console.log('success!') +}) // copies file + +fs.copy('/tmp/mydir', '/tmp/mynewdir', err => { + if (err) return console.error(err) + console.log('success!') +}) // copies directory, even if it has subdirectories or files + +// With Promises: +fs.copy('/tmp/myfile', '/tmp/mynewfile') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) + +// With async/await: +async function example () { + try { + await fs.copy('/tmp/myfile', '/tmp/mynewfile') + console.log('success!') + } catch (err) { + console.error(err) + } +} + +example() +``` + +**Using filter function** + +```js +const fs = require('fs-extra') + +const filterFunc = (src, dest) => { + // your logic here + // it will be copied if return true +} + +fs.copy('/tmp/mydir', '/tmp/mynewdir', { filter: filterFunc }, err => { + if (err) return console.error(err) + console.log('success!') +}) +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/emptyDir-sync.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/emptyDir-sync.md new file mode 100644 index 0000000..7decdbc --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/emptyDir-sync.md @@ -0,0 +1,16 @@ +# emptyDirSync(dir) + +Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. + +**Alias:** `emptydirSync()` + +- `dir` `` + +## Example: + +```js +const fs = require('fs-extra') + +// assume this directory has a lot of files and folders +fs.emptyDirSync('/tmp/some/dir') +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/emptyDir.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/emptyDir.md new file mode 100644 index 0000000..1567760 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/emptyDir.md @@ -0,0 +1,43 @@ +# emptyDir(dir[, callback]) + +Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. + +**Alias:** `emptydir()` + +- `dir` `` +- `callback` `` + - `err` `` + +## Example: + +```js +const fs = require('fs-extra') + +// assume this directory has a lot of files and folders +// With a callback: +fs.emptyDir('/tmp/some/dir', err => { + if (err) return console.error(err) + console.log('success!') +}) + +// With Promises: +fs.emptyDir('/tmp/some/dir') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) + +// With async/await: +async function example () { + try { + await fs.emptyDir('/tmp/some/dir') + console.log('success!') + } catch (err) { + console.error(err) + } +} + +example() +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureDir-sync.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureDir-sync.md new file mode 100644 index 0000000..076307b --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureDir-sync.md @@ -0,0 +1,32 @@ +# ensureDirSync(dir[,options]) + +Ensures that the directory exists. If the directory structure does not exist, it is created. If provided, options may specify the desired mode for the directory. + +**Aliases:** `mkdirsSync()`, `mkdirpSync()` + +- `dir` `` +- `options` ` | ` + - If it is `Integer`, it will be `mode`. + - If it is `Object`, it will be `{ mode: }`. + +## Example: + +```js +const fs = require('fs-extra') + +const dir = '/tmp/this/path/does/not/exist' + +const desiredMode = 0o2775 +const options = { + mode: 0o2775 +} + +fs.ensureDirSync(dir) +// dir has now been created, including the directory it is to be placed in + +fs.ensureDirSync(dir, desiredMode) +// dir has now been created, including the directory it is to be placed in with permission 0o2775 + +fs.ensureDirSync(dir, options) +// dir has now been created, including the directory it is to be placed in with permission 0o2775 +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureDir.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureDir.md new file mode 100644 index 0000000..b9eeaa6 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureDir.md @@ -0,0 +1,76 @@ +# ensureDir(dir[,options][,callback]) + +Ensures that the directory exists. If the directory structure does not exist, it is created. + +**Aliases:** `mkdirs()`, `mkdirp()` + +- `dir` `` +- `options` ` | ` + - If it is `Integer`, it will be `mode`. + - If it is `Object`, it will be `{ mode: }`. +- `callback` `` + - `err` `` + +## Example: + +```js +const fs = require('fs-extra') + +const dir = '/tmp/this/path/does/not/exist' +const desiredMode = 0o2775 +const options = { + mode: 0o2775 +} + +// With a callback: +fs.ensureDir(dir, err => { + console.log(err) // => null + // dir has now been created, including the directory it is to be placed in +}) + +// With a callback and a mode integer +fs.ensureDir(dir, desiredMode, err => { + console.log(err) // => null + // dir has now been created with mode 0o2775, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureDir(dir) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) + +// With Promises and a mode integer: +fs.ensureDir(dir, desiredMode) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) + +// With async/await: +async function example (directory) { + try { + await fs.ensureDir(directory) + console.log('success!') + } catch (err) { + console.error(err) + } +} +example(dir) + +// With async/await and an options object, containing mode: +async function exampleMode (directory) { + try { + await fs.ensureDir(directory, options) + console.log('success!') + } catch (err) { + console.error(err) + } +} +exampleMode(dir) +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureFile-sync.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureFile-sync.md new file mode 100644 index 0000000..25ac39d --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureFile-sync.md @@ -0,0 +1,17 @@ +# ensureFileSync(file) + +Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. + +**Alias:** `createFileSync()` + +- `file` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureFileSync(file) +// file has now been created, including the directory it is to be placed in +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureFile.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureFile.md new file mode 100644 index 0000000..7e96e0c --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureFile.md @@ -0,0 +1,44 @@ +# ensureFile(file[, callback]) + +Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. + +**Alias:** `createFile()` + +- `file` `` +- `callback` `` + - `err` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' + +// With a callback: +fs.ensureFile(file, err => { + console.log(err) // => null + // file has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureFile(file) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) + +// With async/await: +async function example (f) { + try { + await fs.ensureFile(f) + console.log('success!') + } catch (err) { + console.error(err) + } +} + +example(file) +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureLink-sync.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureLink-sync.md new file mode 100644 index 0000000..2196e64 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureLink-sync.md @@ -0,0 +1,19 @@ +# ensureLinkSync(srcPath, destPath) + +Ensures that the link exists. If the directory structure does not exist, it is created. + +**Alias:** `createLinkSync()` + +- `srcPath` `` +- `destPath` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcPath = '/tmp/file.txt' +const destPath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureLinkSync(srcPath, destPath) +// link has now been created, including the directory it is to be placed in +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureLink.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureLink.md new file mode 100644 index 0000000..1214b5f --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureLink.md @@ -0,0 +1,46 @@ +# ensureLink(srcPath, destPath[, callback]) + +Ensures that the link exists. If the directory structure does not exist, it is created. + +**Alias:** `createLink()` + +- `srcPath` `` +- `destPath` `` +- `callback` `` + - `err` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcPath = '/tmp/file.txt' +const destPath = '/tmp/this/path/does/not/exist/file.txt' + +// With a callback: +fs.ensureLink(srcPath, destPath, err => { + console.log(err) // => null + // link has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureLink(srcPath, destPath) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) + +// With async/await: +async function example (src, dest) { + try { + await fs.ensureLink(src, dest) + console.log('success!') + } catch (err) { + console.error(err) + } +} + +example(srcPath, destPath) +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureSymlink-sync.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureSymlink-sync.md new file mode 100644 index 0000000..febbe4f --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureSymlink-sync.md @@ -0,0 +1,20 @@ +# ensureSymlinkSync(srcPath, destPath[, type]) + +Ensures that the symlink exists. If the directory structure does not exist, it is created. + +**Alias:** `createSymlinkSync()` + +- `srcPath` `` +- `destPath` `` +- `type` `` It is only available on Windows and ignored on other platforms. It can be set to `dir`, `file`, or `junction`. + +## Example: + +```js +const fs = require('fs-extra') + +const srcPath = '/tmp/file.txt' +const destPath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureSymlinkSync(srcPath, destPath) +// symlink has now been created, including the directory it is to be placed in +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureSymlink.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureSymlink.md new file mode 100644 index 0000000..737da48 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/ensureSymlink.md @@ -0,0 +1,47 @@ +# ensureSymlink(srcPath, destPath[, type][, callback]) + +Ensures that the symlink exists. If the directory structure does not exist, it is created. + +**Alias:** `createSymlink()` + +- `srcPath` `` +- `destPath` `` +- `type` `` It is only available on Windows and ignored on other platforms. It can be set to `dir`, `file`, or `junction`. +- `callback` `` + - `err` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcPath = '/tmp/file.txt' +const destPath = '/tmp/this/path/does/not/exist/file.txt' + +// With a callback: +fs.ensureSymlink(srcPath, destPath, err => { + console.log(err) // => null + // symlink has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureSymlink(srcPath, destPath) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) + +// With async/await: +async function example (src, dest) { + try { + await fs.ensureSymlink(src, dest) + console.log('success!') + } catch (err) { + console.error(err) + } +} + +example(srcPath, destPath) +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/fs-read-write-writev.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/fs-read-write-writev.md new file mode 100644 index 0000000..be9bd1d --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/fs-read-write-writev.md @@ -0,0 +1,48 @@ +# About `fs.read()` & `fs.write()` + +[`fs.read()`](https://nodejs.org/api/fs.html#fs_fs_read_fd_buffer_offset_length_position_callback), [`fs.write()`](https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback), & [`fs.writev()`](https://nodejs.org/api/fs.html#fs_fs_writev_fd_buffers_position_callback) are different from other `fs` methods in that their callbacks are called with 3 arguments instead of the usual 2 arguments. + +If you're using them with callbacks, they will behave as usual. However, their promise usage is a little different. `fs-extra` promisifies these methods like [`util.promisify()`](https://nodejs.org/api/util.html#util_util_promisify_original) (only available in Node 8+) does. + +Here's the example promise usage: + +## `fs.read()` + +```js +// With Promises: +fs.read(fd, buffer, offset, length, position) + .then(results => { + console.log(results) + // { bytesRead: 20, buffer: } + }) + +// With async/await: +async function example () { + const { bytesRead, buffer } = await fs.read(fd, Buffer.alloc(length), offset, length, position) +} +``` + +## `fs.write()` + +```js +// With Promises: +fs.write(fd, buffer, offset, length, position) + .then(results => { + console.log(results) + // { bytesWritten: 20, buffer: } + }) + +// With async/await: +async function example () { + const { bytesWritten, buffer } = await fs.write(fd, Buffer.alloc(length), offset, length, position) +} +``` + +## `fs.writev()` + +```js +// With async/await: +async function example () { + const { bytesWritten, buffers } = await fs.writev(fd, buffers, position) +} +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/move-sync.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/move-sync.md new file mode 100644 index 0000000..8cc6770 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/move-sync.md @@ -0,0 +1,24 @@ +# moveSync(src, dest[, options]) + +Moves a file or directory, even across devices. + +- `src` `` +- `dest` `` Note: When `src` is a file, `dest` must be a file and when `src` is a directory, `dest` must be a directory. +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `false`. + +## Example: + +```js +const fs = require('fs-extra') + +fs.moveSync('/tmp/somefile', '/tmp/does/not/exist/yet/somefile') +``` + +**Using `overwrite` option** + +```js +const fs = require('fs-extra') + +fs.moveSync('/tmp/somedir', '/tmp/may/already/exist/somedir', { overwrite: true }) +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/move.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/move.md new file mode 100644 index 0000000..7afed78 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/move.md @@ -0,0 +1,57 @@ +# move(src, dest[, options][, callback]) + +Moves a file or directory, even across devices. + +- `src` `` +- `dest` `` Note: When `src` is a file, `dest` must be a file and when `src` is a directory, `dest` must be a directory. +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `false`. +- `callback` `` + - `err` `` + +## Example: + +```js +const fs = require('fs-extra') + +const src = '/tmp/file.txt' +const dest = '/tmp/this/path/does/not/exist/file.txt' + +// With a callback: +fs.move(src, dest, err => { + if (err) return console.error(err) + console.log('success!') +}) + +// With Promises: +fs.move(src, dest) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) + +// With async/await: +async function example (src, dest) { + try { + await fs.move(src, dest) + console.log('success!') + } catch (err) { + console.error(err) + } +} + +example(src, dest) +``` + +**Using `overwrite` option** + +```js +const fs = require('fs-extra') + +fs.move('/tmp/somedir', '/tmp/may/already/exist/somedir', { overwrite: true }, err => { + if (err) return console.error(err) + console.log('success!') +}) +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputFile-sync.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputFile-sync.md new file mode 100644 index 0000000..731e8ab --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputFile-sync.md @@ -0,0 +1,19 @@ +# outputFileSync(file, data[, options]) + +Almost the same as `writeFileSync` (i.e. it overwrites), except that if the parent directory does not exist, it's created. `file` must be a file path (a buffer or a file descriptor is not allowed). + +- `file` `` +- `data` ` | | ` +- `options` ` | ` (the same as [`fs.writeFileSync()` options](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options)) + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.outputFileSync(file, 'hello!') + +const data = fs.readFileSync(file, 'utf8') +console.log(data) // => hello! +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputFile.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputFile.md new file mode 100644 index 0000000..1a82d9a --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputFile.md @@ -0,0 +1,52 @@ +# outputFile(file, data[, options][, callback]) + +Almost the same as `writeFile` (i.e. it overwrites), except that if the parent directory does not exist, it's created. `file` must be a file path (a buffer or a file descriptor is not allowed). + +- `file` `` +- `data` ` | | ` +- `options` ` | ` (the same as [`fs.writeFile()` options](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback)) +- `callback` `` + - `err` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' + +// With a callback: +fs.outputFile(file, 'hello!', err => { + console.log(err) // => null + + fs.readFile(file, 'utf8', (err, data) => { + if (err) return console.error(err) + console.log(data) // => hello! + }) +}) + +// With Promises: +fs.outputFile(file, 'hello!') +.then(() => fs.readFile(file, 'utf8')) +.then(data => { + console.log(data) // => hello! +}) +.catch(err => { + console.error(err) +}) + +// With async/await: +async function example (f) { + try { + await fs.outputFile(f, 'hello!') + + const data = await fs.readFile(f, 'utf8') + + console.log(data) // => hello! + } catch (err) { + console.error(err) + } +} + +example(file) +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputJson-sync.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputJson-sync.md new file mode 100644 index 0000000..8c4b4a5 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputJson-sync.md @@ -0,0 +1,25 @@ +# outputJsonSync(file, object[, options]) + +Almost the same as [`writeJsonSync`](writeJson-sync.md), except that if the directory does not exist, it's created. + +**Alias:** `outputJSONSync()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` ` | ` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFileSync()` options](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options) + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.json' +fs.outputJsonSync(file, {name: 'JP'}) + +const data = fs.readJsonSync(file) +console.log(data.name) // => JP +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputJson.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputJson.md new file mode 100644 index 0000000..dd43547 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/outputJson.md @@ -0,0 +1,58 @@ +# outputJson(file, object[, options][, callback]) + +Almost the same as [`writeJson`](writeJson.md), except that if the directory does not exist, it's created. + +**Alias:** `outputJSON()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` ` | ` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFile()` options](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) +- `callback` `` + - `err` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.json' + +// With a callback: +fs.outputJson(file, {name: 'JP'}, err => { + console.log(err) // => null + + fs.readJson(file, (err, data) => { + if (err) return console.error(err) + console.log(data.name) // => JP + }) +}) + +// With Promises: +fs.outputJson(file, {name: 'JP'}) +.then(() => fs.readJson(file)) +.then(data => { + console.log(data.name) // => JP +}) +.catch(err => { + console.error(err) +}) + +// With async/await: +async function example (f) { + try { + await fs.outputJson(f, {name: 'JP'}) + + const data = await fs.readJson(f) + + console.log(data.name) // => JP + } catch (err) { + console.error(err) + } +} + +example(file) +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/pathExists-sync.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/pathExists-sync.md new file mode 100644 index 0000000..3ef973c --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/pathExists-sync.md @@ -0,0 +1,3 @@ +# pathExistsSync(file) + +An alias for [`fs.existsSync()`](https://nodejs.org/api/fs.html#fs_fs_existssync_path), created for consistency with [`pathExists()`](pathExists.md). diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/pathExists.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/pathExists.md new file mode 100644 index 0000000..b31ed77 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/pathExists.md @@ -0,0 +1,35 @@ +# pathExists(file[, callback]) + +Test whether or not the given path exists by checking with the file system. Like [`fs.exists`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback), but with a normal callback signature (err, exists). Uses `fs.access` under the hood. + +- `file` `` +- `callback` `` + - `err` `` + - `exists` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' + +// With a callback: +fs.pathExists(file, (err, exists) => { + console.log(err) // => null + console.log(exists) // => false +}) + +// Promise usage: +fs.pathExists(file) + .then(exists => console.log(exists)) // => false + +// With async/await: +async function example (f) { + const exists = await fs.pathExists(f) + + console.log(exists) // => false +} + +example(file) +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/readJson-sync.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/readJson-sync.md new file mode 100644 index 0000000..712c998 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/readJson-sync.md @@ -0,0 +1,32 @@ +# readJsonSync(file[, options]) + +Reads a JSON file and then parses it into an object. + +**Alias:** `readJSONSync()` + +- `file` `` +- `options` `` (the same as [`jsonFile.readFileSync()` options](https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options)) + +## Example: + +```js +const fs = require('fs-extra') + +const packageObj = fs.readJsonSync('./package.json') +console.log(packageObj.version) // => 2.0.0 +``` + +--- + +`readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/some-invalid.json' +const data = '{not valid JSON' +fs.writeFileSync(file, data) + +const obj = fs.readJsonSync(file, { throws: false }) +console.log(obj) // => null +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/readJson.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/readJson.md new file mode 100644 index 0000000..0cfb216 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/readJson.md @@ -0,0 +1,79 @@ +# readJson(file[, options][, callback]) + +Reads a JSON file and then parses it into an object. + +**Alias:** `readJSON()` + +- `file` `` +- `options` `` (the same as [`jsonFile.readFile()` options](https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback)) +- `callback` `` + - `err` `` + - `obj` `` + +## Example: + +```js +const fs = require('fs-extra') + +// With a callback: +fs.readJson('./package.json', (err, packageObj) => { + if (err) console.error(err) + console.log(packageObj.version) // => 0.1.3 +}) + +// With Promises: +fs.readJson('./package.json') +.then(packageObj => { + console.log(packageObj.version) // => 0.1.3 +}) +.catch(err => { + console.error(err) +}) + +// With async/await: +async function example () { + try { + const packageObj = await fs.readJson('./package.json') + console.log(packageObj.version) // => 0.1.3 + } catch (err) { + console.error(err) + } +} + +example() +``` + +--- + +`readJson()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/some-invalid.json' +const data = '{not valid JSON' +fs.writeFileSync(file, data) + +// With a callback: +fs.readJson(file, { throws: false }, (err, obj) => { + if (err) console.error(err) + console.log(obj) // => null +}) + +// With Promises: +fs.readJson(file, { throws: false }) +.then(obj => { + console.log(obj) // => null +}) +.catch(err => { + console.error(err) // Not called +}) + +// With async/await: +async function example (f) { + const obj = await fs.readJson(f, { throws: false }) + console.log(obj) // => null +} + +example(file) +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/remove-sync.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/remove-sync.md new file mode 100644 index 0000000..3f763b0 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/remove-sync.md @@ -0,0 +1,16 @@ +# removeSync(path) + +Removes a file or directory. The directory can have contents. If the path does not exist, silently does nothing. + +- `path` `` + +## Example: + +```js +const fs = require('fs-extra') + +// remove file +fs.removeSync('/tmp/myfile') + +fs.removeSync('/home/jprichardson') // I just deleted my entire HOME directory. +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/remove.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/remove.md new file mode 100644 index 0000000..56dd2cf --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/remove.md @@ -0,0 +1,46 @@ +# remove(path[, callback]) + +Removes a file or directory. The directory can have contents. If the path does not exist, silently does nothing. + +- `path` `` +- `callback` `` + - `err` `` + +## Example: + +```js +const fs = require('fs-extra') + +// remove file +// With a callback: +fs.remove('/tmp/myfile', err => { + if (err) return console.error(err) + console.log('success!') +}) + +fs.remove('/home/jprichardson', err => { + if (err) return console.error(err) + console.log('success!') // I just deleted my entire HOME directory. +}) + +// With Promises: +fs.remove('/tmp/myfile') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) + +// With async/await: +async function example (src, dest) { + try { + await fs.remove('/tmp/myfile') + console.log('success!') + } catch (err) { + console.error(err) + } +} + +example() +``` diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/writeJson-sync.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/writeJson-sync.md new file mode 100644 index 0000000..ede2b49 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/writeJson-sync.md @@ -0,0 +1,24 @@ +# writeJsonSync(file, object[, options]) + +Writes an object to a JSON file. + +**Alias:** `writeJSONSync()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` ` | ` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFileSync()` options](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options) + +## Example: + +```js +const fs = require('fs-extra') + +fs.writeJsonSync('./package.json', {name: 'fs-extra'}) +``` +--- + +**See also:** [`outputJsonSync()`](outputJson-sync.md) diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/writeJson.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/writeJson.md new file mode 100644 index 0000000..32fc491 --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/docs/writeJson.md @@ -0,0 +1,52 @@ +# writeJson(file, object[, options][, callback]) + +Writes an object to a JSON file. + +**Alias:** `writeJSON()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` ` | ` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFile()` options](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) +- `callback` `` + - `err` `` + +## Example: + +```js +const fs = require('fs-extra') + +// With a callback: +fs.writeJson('./package.json', {name: 'fs-extra'}, err => { + if (err) return console.error(err) + console.log('success!') +}) + +// With Promises: +fs.writeJson('./package.json', {name: 'fs-extra'}) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) + +// With async/await: +async function example () { + try { + await fs.writeJson('./package.json', {name: 'fs-extra'}) + console.log('success!') + } catch (err) { + console.error(err) + } +} + +example() +``` + +--- + +**See also:** [`outputJson()`](outputJson.md) diff --git a/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/test/readme.md b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/test/readme.md new file mode 100644 index 0000000..1ea7c5b --- /dev/null +++ b/nwjs/packagefiles/tyranobuilder/node_modules/fs-extra/test/readme.md @@ -0,0 +1 @@ +Looking for the test files? You can find all of the test files in `lib/**/__tests__`. \ No newline at end of file