From 3a054c5d5f15ead3c32d7142d844ecfc7241a04e Mon Sep 17 00:00:00 2001 From: Rushbot Date: Fri, 10 Apr 2026 00:36:40 +0000 Subject: [PATCH] docs: update API documentation --- websites/api.rushstack.io/data/api_nav.json | 128 +++++++++++++++--- ...kup-by-path.ilookupbypathjson.delimiter.md | 22 +++ .../pages/lookup-by-path.ilookupbypathjson.md | 109 +++++++++++++++ .../lookup-by-path.ilookupbypathjson.tree.md | 22 +++ ...lookup-by-path.ilookupbypathjson.values.md | 22 +++ .../lookup-by-path.ireadonlylookupbypath.md | 11 ++ ...up-by-path.ireadonlylookupbypath.tojson.md | 69 ++++++++++ ...y-path.iserializedpathtrienode.children.md | 22 +++ .../lookup-by-path.iserializedpathtrienode.md | 86 ++++++++++++ ...path.iserializedpathtrienode.valueindex.md | 22 +++ .../lookup-by-path.lookupbypath.fromjson.md | 85 ++++++++++++ .../docs/pages/lookup-by-path.lookupbypath.md | 30 ++++ .../lookup-by-path.lookupbypath.tojson.md | 69 ++++++++++ .../docs/pages/lookup-by-path.md | 22 +++ ...de-core-library.filesystem.appendtofile.md | 4 +- ...ore-library.filesystem.createreadstream.md | 62 +++++++++ ...re-library.filesystem.createwritestream.md | 82 +++++++++++ ...brary.filesystem.createwritestreamasync.md | 74 ++++++++++ .../pages/node-core-library.filesystem.md | 48 +++++++ ...e-library.filesystem.writebufferstofile.md | 2 +- .../node-core-library.filesystem.writefile.md | 4 +- .../node-core-library.filesystemreadstream.md | 24 ++++ ...node-core-library.filesystemwritestream.md | 24 ++++ ...ary.ifilesystemcreatewritestreamoptions.md | 21 +++ ...ode-core-library.ifilesystemmoveoptions.md | 22 +-- ...itebinaryfileoptions.ensurefolderexists.md | 19 --- ...brary.ifilesystemwritebinaryfileoptions.md | 47 +------ ...ritefileoptionsbase.ensurefolderexists.md} | 38 +++--- ...library.ifilesystemwritefileoptionsbase.md | 63 +++++++++ .../docs/pages/node-core-library.md | 43 ++++++ 30 files changed, 1170 insertions(+), 126 deletions(-) create mode 100644 websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.delimiter.md create mode 100644 websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.md create mode 100644 websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.tree.md create mode 100644 websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.values.md create mode 100644 websites/api.rushstack.io/docs/pages/lookup-by-path.ireadonlylookupbypath.tojson.md create mode 100644 websites/api.rushstack.io/docs/pages/lookup-by-path.iserializedpathtrienode.children.md create mode 100644 websites/api.rushstack.io/docs/pages/lookup-by-path.iserializedpathtrienode.md create mode 100644 websites/api.rushstack.io/docs/pages/lookup-by-path.iserializedpathtrienode.valueindex.md create mode 100644 websites/api.rushstack.io/docs/pages/lookup-by-path.lookupbypath.fromjson.md create mode 100644 websites/api.rushstack.io/docs/pages/lookup-by-path.lookupbypath.tojson.md create mode 100644 websites/api.rushstack.io/docs/pages/node-core-library.filesystem.createreadstream.md create mode 100644 websites/api.rushstack.io/docs/pages/node-core-library.filesystem.createwritestream.md create mode 100644 websites/api.rushstack.io/docs/pages/node-core-library.filesystem.createwritestreamasync.md create mode 100644 websites/api.rushstack.io/docs/pages/node-core-library.filesystemreadstream.md create mode 100644 websites/api.rushstack.io/docs/pages/node-core-library.filesystemwritestream.md create mode 100644 websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemcreatewritestreamoptions.md delete mode 100644 websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritebinaryfileoptions.ensurefolderexists.md rename websites/api.rushstack.io/docs/pages/{node-core-library.ifilesystemmoveoptions.ensurefolderexists.md => node-core-library.ifilesystemwritefileoptionsbase.ensurefolderexists.md} (57%) create mode 100644 websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritefileoptionsbase.md diff --git a/websites/api.rushstack.io/data/api_nav.json b/websites/api.rushstack.io/data/api_nav.json index d74280396..5453c9c12 100644 --- a/websites/api.rushstack.io/data/api_nav.json +++ b/websites/api.rushstack.io/data/api_nav.json @@ -10278,6 +10278,32 @@ } ] }, + { + "type": "category", + "label": "ILookupByPathJson", + "items": [ + { + "type": "doc", + "label": "(members)", + "id": "pages/lookup-by-path.ilookupbypathjson" + }, + { + "type": "doc", + "label": "delimiter", + "id": "pages/lookup-by-path.ilookupbypathjson.delimiter" + }, + { + "type": "doc", + "label": "tree", + "id": "pages/lookup-by-path.ilookupbypathjson.tree" + }, + { + "type": "doc", + "label": "values", + "id": "pages/lookup-by-path.ilookupbypathjson.values" + } + ] + }, { "type": "category", "label": "IPrefixMatch", @@ -10357,6 +10383,11 @@ "type": "doc", "label": "has", "id": "pages/lookup-by-path.ireadonlylookupbypath.has" + }, + { + "type": "doc", + "label": "toJson", + "id": "pages/lookup-by-path.ireadonlylookupbypath.tojson" } ] }, @@ -10381,6 +10412,27 @@ } ] }, + { + "type": "category", + "label": "ISerializedPathTrieNode", + "items": [ + { + "type": "doc", + "label": "(members)", + "id": "pages/lookup-by-path.iserializedpathtrienode" + }, + { + "type": "doc", + "label": "children", + "id": "pages/lookup-by-path.iserializedpathtrienode.children" + }, + { + "type": "doc", + "label": "valueIndex", + "id": "pages/lookup-by-path.iserializedpathtrienode.valueindex" + } + ] + }, { "type": "category", "label": "LookupByPath", @@ -10440,6 +10492,11 @@ "label": "findLongestPrefixMatch", "id": "pages/lookup-by-path.lookupbypath.findlongestprefixmatch" }, + { + "type": "doc", + "label": "fromJson", + "id": "pages/lookup-by-path.lookupbypath.fromjson" + }, { "type": "doc", "label": "get", @@ -10480,6 +10537,11 @@ "label": "size", "id": "pages/lookup-by-path.lookupbypath.size" }, + { + "type": "doc", + "label": "toJson", + "id": "pages/lookup-by-path.lookupbypath.tojson" + }, { "type": "doc", "label": "tree", @@ -11377,6 +11439,11 @@ "label": "createHardLinkAsync", "id": "pages/node-core-library.filesystem.createhardlinkasync" }, + { + "type": "doc", + "label": "createReadStream", + "id": "pages/node-core-library.filesystem.createreadstream" + }, { "type": "doc", "label": "createSymbolicLinkFile", @@ -11407,6 +11474,16 @@ "label": "createSymbolicLinkJunctionAsync", "id": "pages/node-core-library.filesystem.createsymboliclinkjunctionasync" }, + { + "type": "doc", + "label": "createWriteStream", + "id": "pages/node-core-library.filesystem.createwritestream" + }, + { + "type": "doc", + "label": "createWriteStreamAsync", + "id": "pages/node-core-library.filesystem.createwritestreamasync" + }, { "type": "doc", "label": "deleteFile", @@ -11644,11 +11721,21 @@ "label": "FileSystemCopyFilesFilter", "id": "pages/node-core-library.filesystemcopyfilesfilter" }, + { + "type": "doc", + "label": "FileSystemReadStream", + "id": "pages/node-core-library.filesystemreadstream" + }, { "type": "doc", "label": "FileSystemStats", "id": "pages/node-core-library.filesystemstats" }, + { + "type": "doc", + "label": "FileSystemWriteStream", + "id": "pages/node-core-library.filesystemwritestream" + }, { "type": "category", "label": "FileWriter", @@ -11987,6 +12074,11 @@ } ] }, + { + "type": "doc", + "label": "IFileSystemCreateWriteStreamOptions", + "id": "pages/node-core-library.ifilesystemcreatewritestreamoptions" + }, { "type": "category", "label": "IFileSystemDeleteFileOptions", @@ -12017,11 +12109,6 @@ "label": "destinationPath", "id": "pages/node-core-library.ifilesystemmoveoptions.destinationpath" }, - { - "type": "doc", - "label": "ensureFolderExists", - "id": "pages/node-core-library.ifilesystemmoveoptions.ensurefolderexists" - }, { "type": "doc", "label": "overwrite", @@ -12093,20 +12180,9 @@ ] }, { - "type": "category", + "type": "doc", "label": "IFileSystemWriteBinaryFileOptions", - "items": [ - { - "type": "doc", - "label": "(members)", - "id": "pages/node-core-library.ifilesystemwritebinaryfileoptions" - }, - { - "type": "doc", - "label": "ensureFolderExists", - "id": "pages/node-core-library.ifilesystemwritebinaryfileoptions.ensurefolderexists" - } - ] + "id": "pages/node-core-library.ifilesystemwritebinaryfileoptions" }, { "type": "category", @@ -12129,6 +12205,22 @@ } ] }, + { + "type": "category", + "label": "IFileSystemWriteFileOptionsBase", + "items": [ + { + "type": "doc", + "label": "(members)", + "id": "pages/node-core-library.ifilesystemwritefileoptionsbase" + }, + { + "type": "doc", + "label": "ensureFolderExists", + "id": "pages/node-core-library.ifilesystemwritefileoptionsbase.ensurefolderexists" + } + ] + }, { "type": "category", "label": "IFileWriterFlags", diff --git a/websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.delimiter.md b/websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.delimiter.md new file mode 100644 index 000000000..1d598ce78 --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.delimiter.md @@ -0,0 +1,22 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/lookup-by-path](./lookup-by-path.md) > [ILookupByPathJson](./lookup-by-path.ilookupbypathjson.md) > [delimiter](./lookup-by-path.ilookupbypathjson.delimiter.md) + +## ILookupByPathJson.delimiter property + +> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The path delimiter used by the serialized trie. + +**Signature:** + +```typescript +delimiter: string; +``` diff --git a/websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.md b/websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.md new file mode 100644 index 000000000..a57108f49 --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.md @@ -0,0 +1,109 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/lookup-by-path](./lookup-by-path.md) > [ILookupByPathJson](./lookup-by-path.ilookupbypathjson.md) + +## ILookupByPathJson interface + +> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +JSON-serializable representation of a [LookupByPath](./lookup-by-path.lookupbypath.md) instance. + +**Signature:** + +```typescript +export interface ILookupByPathJson +``` + +## Remarks + +The `values` array stores each unique value exactly once (by reference identity). Nodes in the tree reference values by their index in this array, which ensures that reference equality is preserved across serialization and deserialization. + +## Properties + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[delimiter](./lookup-by-path.ilookupbypathjson.delimiter.md) + + + + + + + +string + + + + +**_(BETA)_** The path delimiter used by the serialized trie. + + +
+ +[tree](./lookup-by-path.ilookupbypathjson.tree.md) + + + + + + + +[ISerializedPathTrieNode](./lookup-by-path.iserializedpathtrienode.md) + + + + +**_(BETA)_** The serialized tree structure. + + +
+ +[values](./lookup-by-path.ilookupbypathjson.values.md) + + + + + + + +TSerialized\[\] + + + + +**_(BETA)_** Array of serialized values. Nodes in the tree reference values by their index in this array. Using an array with index-based references preserves reference equality: if multiple nodes share the same value (by reference), they will reference the same index. + + +
+ diff --git a/websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.tree.md b/websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.tree.md new file mode 100644 index 000000000..176f47b3a --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.tree.md @@ -0,0 +1,22 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/lookup-by-path](./lookup-by-path.md) > [ILookupByPathJson](./lookup-by-path.ilookupbypathjson.md) > [tree](./lookup-by-path.ilookupbypathjson.tree.md) + +## ILookupByPathJson.tree property + +> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +The serialized tree structure. + +**Signature:** + +```typescript +tree: ISerializedPathTrieNode; +``` diff --git a/websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.values.md b/websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.values.md new file mode 100644 index 000000000..2aa4b3e53 --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/lookup-by-path.ilookupbypathjson.values.md @@ -0,0 +1,22 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/lookup-by-path](./lookup-by-path.md) > [ILookupByPathJson](./lookup-by-path.ilookupbypathjson.md) > [values](./lookup-by-path.ilookupbypathjson.values.md) + +## ILookupByPathJson.values property + +> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Array of serialized values. Nodes in the tree reference values by their index in this array. Using an array with index-based references preserves reference equality: if multiple nodes share the same value (by reference), they will reference the same index. + +**Signature:** + +```typescript +values: TSerialized[]; +``` diff --git a/websites/api.rushstack.io/docs/pages/lookup-by-path.ireadonlylookupbypath.md b/websites/api.rushstack.io/docs/pages/lookup-by-path.ireadonlylookupbypath.md index 3ee147638..81932dbca 100644 --- a/websites/api.rushstack.io/docs/pages/lookup-by-path.ireadonlylookupbypath.md +++ b/websites/api.rushstack.io/docs/pages/lookup-by-path.ireadonlylookupbypath.md @@ -133,6 +133,17 @@ Description **_(BETA)_** Determines if an entry exists exactly at the specified path. + + + +[toJson(serializeValue)](./lookup-by-path.ireadonlylookupbypath.tojson.md) + + + + +**_(BETA)_** Serializes this `LookupByPath` instance to a JSON-compatible representation. + + diff --git a/websites/api.rushstack.io/docs/pages/lookup-by-path.ireadonlylookupbypath.tojson.md b/websites/api.rushstack.io/docs/pages/lookup-by-path.ireadonlylookupbypath.tojson.md new file mode 100644 index 000000000..86e31855b --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/lookup-by-path.ireadonlylookupbypath.tojson.md @@ -0,0 +1,69 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/lookup-by-path](./lookup-by-path.md) > [IReadonlyLookupByPath](./lookup-by-path.ireadonlylookupbypath.md) > [toJson](./lookup-by-path.ireadonlylookupbypath.tojson.md) + +## IReadonlyLookupByPath.toJson() method + +> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Serializes this `LookupByPath` instance to a JSON-compatible representation. + +**Signature:** + +```typescript +toJson(serializeValue: (value: TItem) => TSerialized): ILookupByPathJson; +``` + +## Parameters + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +serializeValue + + + + +(value: TItem) => TSerialized + + + + +A function that converts a value of type `TItem` to a JSON-serializable form. + + +
+ +**Returns:** + +[ILookupByPathJson](./lookup-by-path.ilookupbypathjson.md)<><TSerialized> + +A JSON-serializable representation of this trie. + +## Remarks + +Values that are reference-equal will be serialized once and referenced by index, ensuring that reference equality is preserved when deserialized via [LookupByPath.fromJson()](./lookup-by-path.lookupbypath.fromjson.md)<>. + diff --git a/websites/api.rushstack.io/docs/pages/lookup-by-path.iserializedpathtrienode.children.md b/websites/api.rushstack.io/docs/pages/lookup-by-path.iserializedpathtrienode.children.md new file mode 100644 index 000000000..2019312ab --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/lookup-by-path.iserializedpathtrienode.children.md @@ -0,0 +1,22 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/lookup-by-path](./lookup-by-path.md) > [ISerializedPathTrieNode](./lookup-by-path.iserializedpathtrienode.md) > [children](./lookup-by-path.iserializedpathtrienode.children.md) + +## ISerializedPathTrieNode.children property + +> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Child nodes keyed by path segment. + +**Signature:** + +```typescript +children?: Record; +``` diff --git a/websites/api.rushstack.io/docs/pages/lookup-by-path.iserializedpathtrienode.md b/websites/api.rushstack.io/docs/pages/lookup-by-path.iserializedpathtrienode.md new file mode 100644 index 000000000..2474b50a5 --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/lookup-by-path.iserializedpathtrienode.md @@ -0,0 +1,86 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/lookup-by-path](./lookup-by-path.md) > [ISerializedPathTrieNode](./lookup-by-path.iserializedpathtrienode.md) + +## ISerializedPathTrieNode interface + +> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +JSON-serializable representation of a node in a [LookupByPath](./lookup-by-path.lookupbypath.md) trie. + +**Signature:** + +```typescript +export interface ISerializedPathTrieNode +``` + +## Properties + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[children?](./lookup-by-path.iserializedpathtrienode.children.md) + + + + + + + +Record<string, [ISerializedPathTrieNode](./lookup-by-path.iserializedpathtrienode.md)<>> + + + + +**_(BETA)_** _(Optional)_ Child nodes keyed by path segment. + + +
+ +[valueIndex?](./lookup-by-path.iserializedpathtrienode.valueindex.md) + + + + + + + +number + + + + +**_(BETA)_** _(Optional)_ Index into the `values` array of the containing [ILookupByPathJson](./lookup-by-path.ilookupbypathjson.md)<>. If `undefined`<>, this node has no associated value. + + +
+ diff --git a/websites/api.rushstack.io/docs/pages/lookup-by-path.iserializedpathtrienode.valueindex.md b/websites/api.rushstack.io/docs/pages/lookup-by-path.iserializedpathtrienode.valueindex.md new file mode 100644 index 000000000..a8e157786 --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/lookup-by-path.iserializedpathtrienode.valueindex.md @@ -0,0 +1,22 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/lookup-by-path](./lookup-by-path.md) > [ISerializedPathTrieNode](./lookup-by-path.iserializedpathtrienode.md) > [valueIndex](./lookup-by-path.iserializedpathtrienode.valueindex.md) + +## ISerializedPathTrieNode.valueIndex property + +> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Index into the `values` array of the containing [ILookupByPathJson](./lookup-by-path.ilookupbypathjson.md)<>. If `undefined`<>, this node has no associated value. + +**Signature:** + +```typescript +valueIndex?: number; +``` diff --git a/websites/api.rushstack.io/docs/pages/lookup-by-path.lookupbypath.fromjson.md b/websites/api.rushstack.io/docs/pages/lookup-by-path.lookupbypath.fromjson.md new file mode 100644 index 000000000..cc52f1af6 --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/lookup-by-path.lookupbypath.fromjson.md @@ -0,0 +1,85 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/lookup-by-path](./lookup-by-path.md) > [LookupByPath](./lookup-by-path.lookupbypath.md) > [fromJson](./lookup-by-path.lookupbypath.fromjson.md) + +## LookupByPath.fromJson() method + +> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Deserializes a `LookupByPath` instance from a JSON representation previously created by [LookupByPath.toJson()](./lookup-by-path.lookupbypath.tojson.md)<>. + +**Signature:** + +```typescript +static fromJson(json: ILookupByPathJson, deserializeValue: (serialized: TSerialized) => TItem): LookupByPath; +``` + +## Parameters + + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +json + + + + +[ILookupByPathJson](./lookup-by-path.ilookupbypathjson.md)<><TSerialized> + + + + +The JSON representation to deserialize. + + +
+ +deserializeValue + + + + +(serialized: TSerialized) => TItem + + + + +A function that converts a serialized value back to its original type. + + +
+ +**Returns:** + +[LookupByPath](./lookup-by-path.lookupbypath.md)<><TItem> + +A new `LookupByPath` instance. + +## Remarks + +Reference equality is preserved: if multiple nodes in the serialized trie pointed at the same value (i.e., the same index in the `values` array), the deserialized nodes will share the same object reference. + diff --git a/websites/api.rushstack.io/docs/pages/lookup-by-path.lookupbypath.md b/websites/api.rushstack.io/docs/pages/lookup-by-path.lookupbypath.md index 4c04d69e4..8ed6fb06f 100644 --- a/websites/api.rushstack.io/docs/pages/lookup-by-path.lookupbypath.md +++ b/websites/api.rushstack.io/docs/pages/lookup-by-path.lookupbypath.md @@ -289,6 +289,22 @@ Description **_(BETA)_** The readonly component of `LookupByPath`<>, to simplify unit testing. + + + +[fromJson(json, deserializeValue)](./lookup-by-path.lookupbypath.fromjson.md) + + + + +`static` + + + + +**_(BETA)_** Deserializes a `LookupByPath` instance from a JSON representation previously created by [LookupByPath.toJson()](./lookup-by-path.lookupbypath.tojson.md)<>. + + @@ -389,6 +405,20 @@ Description **_(BETA)_** Associates the value with the specified path. If a value is already associated, will overwrite. + + + +[toJson(serializeValue)](./lookup-by-path.lookupbypath.tojson.md) + + + + + + + +**_(BETA)_** Serializes this `LookupByPath` instance to a JSON-compatible representation. + + diff --git a/websites/api.rushstack.io/docs/pages/lookup-by-path.lookupbypath.tojson.md b/websites/api.rushstack.io/docs/pages/lookup-by-path.lookupbypath.tojson.md new file mode 100644 index 000000000..38199e6cc --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/lookup-by-path.lookupbypath.tojson.md @@ -0,0 +1,69 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/lookup-by-path](./lookup-by-path.md) > [LookupByPath](./lookup-by-path.lookupbypath.md) > [toJson](./lookup-by-path.lookupbypath.tojson.md) + +## LookupByPath.toJson() method + +> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Serializes this `LookupByPath` instance to a JSON-compatible representation. + +**Signature:** + +```typescript +toJson(serializeValue: (value: TItem) => TSerialized): ILookupByPathJson; +``` + +## Parameters + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +serializeValue + + + + +(value: TItem) => TSerialized + + + + +A function that converts a value of type `TItem` to a JSON-serializable form. + + +
+ +**Returns:** + +[ILookupByPathJson](./lookup-by-path.ilookupbypathjson.md)<><TSerialized> + +A JSON-serializable representation of this trie. + +## Remarks + +Values that are reference-equal will be serialized once and referenced by index, ensuring that reference equality is preserved when deserialized via [LookupByPath.fromJson()](./lookup-by-path.lookupbypath.fromjson.md)<>. + diff --git a/websites/api.rushstack.io/docs/pages/lookup-by-path.md b/websites/api.rushstack.io/docs/pages/lookup-by-path.md index 405eb1d66..627eb1d15 100644 --- a/websites/api.rushstack.io/docs/pages/lookup-by-path.md +++ b/websites/api.rushstack.io/docs/pages/lookup-by-path.md @@ -91,6 +91,17 @@ Description **_(BETA)_** Options for the getFirstDifferenceInCommonNodes function. + + + +[ILookupByPathJson](./lookup-by-path.ilookupbypathjson.md) + + + + +**_(BETA)_** JSON-serializable representation of a [LookupByPath](./lookup-by-path.lookupbypath.md) instance. + + @@ -124,6 +135,17 @@ Description **_(BETA)_** Readonly view of a node in the path trie used in LookupByPath + + + +[ISerializedPathTrieNode](./lookup-by-path.iserializedpathtrienode.md) + + + + +**_(BETA)_** JSON-serializable representation of a node in a [LookupByPath](./lookup-by-path.lookupbypath.md) trie. + + diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.appendtofile.md b/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.appendtofile.md index 52584ff35..6d2376ca4 100644 --- a/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.appendtofile.md +++ b/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.appendtofile.md @@ -80,7 +80,7 @@ options -_(Optional)_ Optional settings that can change the behavior. Type: `IWriteFileOptions` +_(Optional)_ Optional settings that can change the behavior. @@ -92,5 +92,5 @@ void ## Remarks -Throws an error if the folder doesn't exist, unless ensureFolder=true. +Throws an error if the folder doesn't exist, unless [IFileSystemWriteFileOptionsBase.ensureFolderExists](./node-core-library.ifilesystemwritefileoptionsbase.ensurefolderexists.md) is set to `true`<>. diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.createreadstream.md b/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.createreadstream.md new file mode 100644 index 000000000..c11366dbb --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.createreadstream.md @@ -0,0 +1,62 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/node-core-library](./node-core-library.md) > [FileSystem](./node-core-library.filesystem.md) > [createReadStream](./node-core-library.filesystem.createreadstream.md) + +## FileSystem.createReadStream() method + +Creates a readable stream for an existing file. Behind the scenes it uses `fs.createReadStream()`<>. + +**Signature:** + +```typescript +static createReadStream(filePath: string): FileSystemReadStream; +``` + +## Parameters + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +filePath + + + + +string + + + + +The path to the file. The path may be absolute or relative. + + +
+ +**Returns:** + +[FileSystemReadStream](./node-core-library.filesystemreadstream.md) + +A new readable stream for the file. + diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.createwritestream.md b/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.createwritestream.md new file mode 100644 index 000000000..3e86114a2 --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.createwritestream.md @@ -0,0 +1,82 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/node-core-library](./node-core-library.md) > [FileSystem](./node-core-library.filesystem.md) > [createWriteStream](./node-core-library.filesystem.createwritestream.md) + +## FileSystem.createWriteStream() method + +Creates a writable stream for writing to a file. Behind the scenes it uses `fs.createWriteStream()`<>. + +**Signature:** + +```typescript +static createWriteStream(filePath: string, options?: IFileSystemCreateWriteStreamOptions): FileSystemWriteStream; +``` + +## Parameters + + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +filePath + + + + +string + + + + +The path to the file. The path may be absolute or relative. + + +
+ +options + + + + +[IFileSystemCreateWriteStreamOptions](./node-core-library.ifilesystemcreatewritestreamoptions.md) + + + + +_(Optional)_ Optional settings that can change the behavior. + + +
+ +**Returns:** + +[FileSystemWriteStream](./node-core-library.filesystemwritestream.md) + +A new writable stream for the file. + +## Remarks + +Throws an error if the folder doesn't exist, unless [IFileSystemWriteFileOptionsBase.ensureFolderExists](./node-core-library.ifilesystemwritefileoptionsbase.ensurefolderexists.md) is set to `true`<>. + diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.createwritestreamasync.md b/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.createwritestreamasync.md new file mode 100644 index 000000000..d5758120b --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.createwritestreamasync.md @@ -0,0 +1,74 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/node-core-library](./node-core-library.md) > [FileSystem](./node-core-library.filesystem.md) > [createWriteStreamAsync](./node-core-library.filesystem.createwritestreamasync.md) + +## FileSystem.createWriteStreamAsync() method + +An async version of [FileSystem.createWriteStream()](./node-core-library.filesystem.createwritestream.md)<>. + +**Signature:** + +```typescript +static createWriteStreamAsync(filePath: string, options?: IFileSystemCreateWriteStreamOptions): Promise; +``` + +## Parameters + + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +filePath + + + + +string + + + + + +
+ +options + + + + +[IFileSystemCreateWriteStreamOptions](./node-core-library.ifilesystemcreatewritestreamoptions.md) + + + + +_(Optional)_ + + +
+ +**Returns:** + +Promise<[FileSystemWriteStream](./node-core-library.filesystemwritestream.md)<>> + diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.md b/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.md index 809079c57..cb6c01a52 100644 --- a/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.md +++ b/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.md @@ -201,6 +201,22 @@ Creates a hard link. The link target must be a file, not a folder. Behind the sc An async version of [FileSystem.createHardLink()](./node-core-library.filesystem.createhardlink.md)<>. + + + +[createReadStream(filePath)](./node-core-library.filesystem.createreadstream.md) + + + + +`static` + + + + +Creates a readable stream for an existing file. Behind the scenes it uses `fs.createReadStream()`<>. + + @@ -297,6 +313,38 @@ Creates an NTFS "directory junction" on Windows operating systems; for other ope An async version of [FileSystem.createSymbolicLinkJunction()](./node-core-library.filesystem.createsymboliclinkjunction.md)<>. + + + +[createWriteStream(filePath, options)](./node-core-library.filesystem.createwritestream.md) + + + + +`static` + + + + +Creates a writable stream for writing to a file. Behind the scenes it uses `fs.createWriteStream()`<>. + + + + + +[createWriteStreamAsync(filePath, options)](./node-core-library.filesystem.createwritestreamasync.md) + + + + +`static` + + + + +An async version of [FileSystem.createWriteStream()](./node-core-library.filesystem.createwritestream.md)<>. + + diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.writebufferstofile.md b/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.writebufferstofile.md index 27732197f..82298dcdb 100644 --- a/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.writebufferstofile.md +++ b/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.writebufferstofile.md @@ -94,5 +94,5 @@ void ## Remarks -Throws an error if the folder doesn't exist, unless ensureFolder=true. +Throws an error if the folder doesn't exist, unless [IFileSystemWriteFileOptionsBase.ensureFolderExists](./node-core-library.ifilesystemwritefileoptionsbase.ensurefolderexists.md) is set to `true`<>. diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.writefile.md b/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.writefile.md index b96fa4d5a..33f751ace 100644 --- a/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.writefile.md +++ b/websites/api.rushstack.io/docs/pages/node-core-library.filesystem.writefile.md @@ -80,7 +80,7 @@ options -_(Optional)_ Optional settings that can change the behavior. Type: `IWriteFileOptions` +_(Optional)_ Optional settings that can change the behavior. @@ -92,5 +92,5 @@ void ## Remarks -Throws an error if the folder doesn't exist, unless ensureFolder=true. +Throws an error if the folder doesn't exist, unless [IFileSystemWriteFileOptionsBase.ensureFolderExists](./node-core-library.ifilesystemwritefileoptionsbase.ensurefolderexists.md) is set to `true`<>. diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.filesystemreadstream.md b/websites/api.rushstack.io/docs/pages/node-core-library.filesystemreadstream.md new file mode 100644 index 000000000..b3e059349 --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/node-core-library.filesystemreadstream.md @@ -0,0 +1,24 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/node-core-library](./node-core-library.md) > [FileSystemReadStream](./node-core-library.filesystemreadstream.md) + +## FileSystemReadStream type + +An alias for the Node.js `fs.ReadStream` object. + +**Signature:** + +```typescript +export type FileSystemReadStream = fs.ReadStream; +``` + +## Remarks + +This avoids the need to import the `fs` package when using the [FileSystem](./node-core-library.filesystem.md) API. + diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.filesystemwritestream.md b/websites/api.rushstack.io/docs/pages/node-core-library.filesystemwritestream.md new file mode 100644 index 000000000..af329c88d --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/node-core-library.filesystemwritestream.md @@ -0,0 +1,24 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/node-core-library](./node-core-library.md) > [FileSystemWriteStream](./node-core-library.filesystemwritestream.md) + +## FileSystemWriteStream type + +An alias for the Node.js `fs.WriteStream` object. + +**Signature:** + +```typescript +export type FileSystemWriteStream = fs.WriteStream; +``` + +## Remarks + +This avoids the need to import the `fs` package when using the [FileSystem](./node-core-library.filesystem.md) API. + diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemcreatewritestreamoptions.md b/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemcreatewritestreamoptions.md new file mode 100644 index 000000000..73223b903 --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemcreatewritestreamoptions.md @@ -0,0 +1,21 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/node-core-library](./node-core-library.md) > [IFileSystemCreateWriteStreamOptions](./node-core-library.ifilesystemcreatewritestreamoptions.md) + +## IFileSystemCreateWriteStreamOptions interface + +The options for [FileSystem.createWriteStream()](./node-core-library.filesystem.createwritestream.md) + +**Signature:** + +```typescript +export interface IFileSystemCreateWriteStreamOptions extends IFileSystemWriteFileOptionsBase +``` +**Extends:** [IFileSystemWriteFileOptionsBase](./node-core-library.ifilesystemwritefileoptionsbase.md) + diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemmoveoptions.md b/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemmoveoptions.md index e6f48a4fc..32a1cb5b9 100644 --- a/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemmoveoptions.md +++ b/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemmoveoptions.md @@ -15,8 +15,9 @@ The options for [FileSystem.move()](./node-core-library.filesystem.move.md) **Signature:** ```typescript -export interface IFileSystemMoveOptions +export interface IFileSystemMoveOptions extends IFileSystemWriteFileOptionsBase ``` +**Extends:** [IFileSystemWriteFileOptionsBase](./node-core-library.ifilesystemwritefileoptionsbase.md) ## Properties @@ -59,25 +60,6 @@ string The new path for the object. The path may be absolute or relative. - - - -[ensureFolderExists?](./node-core-library.ifilesystemmoveoptions.ensurefolderexists.md) - - - - - - - -boolean - - - - -_(Optional)_ If true, will ensure the folder is created before writing the file. - - diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritebinaryfileoptions.ensurefolderexists.md b/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritebinaryfileoptions.ensurefolderexists.md deleted file mode 100644 index bfbb83348..000000000 --- a/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritebinaryfileoptions.ensurefolderexists.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: true -custom_edit_url: null -pagination_prev: null -pagination_next: null ---- - - -[Home](./index.md) > [@rushstack/node-core-library](./node-core-library.md) > [IFileSystemWriteBinaryFileOptions](./node-core-library.ifilesystemwritebinaryfileoptions.md) > [ensureFolderExists](./node-core-library.ifilesystemwritebinaryfileoptions.ensurefolderexists.md) - -## IFileSystemWriteBinaryFileOptions.ensureFolderExists property - -If true, will ensure the folder is created before writing the file. - -**Signature:** - -```typescript -ensureFolderExists?: boolean; -``` diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritebinaryfileoptions.md b/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritebinaryfileoptions.md index 30bab79fa..7a9178e3f 100644 --- a/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritebinaryfileoptions.md +++ b/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritebinaryfileoptions.md @@ -15,50 +15,7 @@ The options for [FileSystem.writeBuffersToFile()](./node-core-library.filesystem **Signature:** ```typescript -export interface IFileSystemWriteBinaryFileOptions +export interface IFileSystemWriteBinaryFileOptions extends IFileSystemWriteFileOptionsBase ``` - -## Properties - - - -
- -Property - - - - -Modifiers - - - - -Type - - - - -Description - - -
- -[ensureFolderExists?](./node-core-library.ifilesystemwritebinaryfileoptions.ensurefolderexists.md) - - - - - - - -boolean - - - - -_(Optional)_ If true, will ensure the folder is created before writing the file. - - -
+**Extends:** [IFileSystemWriteFileOptionsBase](./node-core-library.ifilesystemwritefileoptionsbase.md) diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemmoveoptions.ensurefolderexists.md b/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritefileoptionsbase.ensurefolderexists.md similarity index 57% rename from websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemmoveoptions.ensurefolderexists.md rename to websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritefileoptionsbase.ensurefolderexists.md index d00692a44..a6cfc29a4 100644 --- a/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemmoveoptions.ensurefolderexists.md +++ b/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritefileoptionsbase.ensurefolderexists.md @@ -1,19 +1,19 @@ ---- -hide_title: true -custom_edit_url: null -pagination_prev: null -pagination_next: null ---- - - -[Home](./index.md) > [@rushstack/node-core-library](./node-core-library.md) > [IFileSystemMoveOptions](./node-core-library.ifilesystemmoveoptions.md) > [ensureFolderExists](./node-core-library.ifilesystemmoveoptions.ensurefolderexists.md) - -## IFileSystemMoveOptions.ensureFolderExists property - -If true, will ensure the folder is created before writing the file. - -**Signature:** - -```typescript -ensureFolderExists?: boolean; -``` +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/node-core-library](./node-core-library.md) > [IFileSystemWriteFileOptionsBase](./node-core-library.ifilesystemwritefileoptionsbase.md) > [ensureFolderExists](./node-core-library.ifilesystemwritefileoptionsbase.ensurefolderexists.md) + +## IFileSystemWriteFileOptionsBase.ensureFolderExists property + +If true, will ensure the folder is created before writing the file. + +**Signature:** + +```typescript +ensureFolderExists?: boolean; +``` diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritefileoptionsbase.md b/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritefileoptionsbase.md new file mode 100644 index 000000000..6785f1b33 --- /dev/null +++ b/websites/api.rushstack.io/docs/pages/node-core-library.ifilesystemwritefileoptionsbase.md @@ -0,0 +1,63 @@ +--- +hide_title: true +custom_edit_url: null +pagination_prev: null +pagination_next: null +--- + + +[Home](./index.md) > [@rushstack/node-core-library](./node-core-library.md) > [IFileSystemWriteFileOptionsBase](./node-core-library.ifilesystemwritefileoptionsbase.md) + +## IFileSystemWriteFileOptionsBase interface + + +**Signature:** + +```typescript +export interface IFileSystemWriteFileOptionsBase +``` + +## Properties + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[ensureFolderExists?](./node-core-library.ifilesystemwritefileoptionsbase.ensurefolderexists.md) + + + + + + + +boolean + + + + +_(Optional)_ If true, will ensure the folder is created before writing the file. + + +
+ diff --git a/websites/api.rushstack.io/docs/pages/node-core-library.md b/websites/api.rushstack.io/docs/pages/node-core-library.md index d282ec0e0..23d666b96 100644 --- a/websites/api.rushstack.io/docs/pages/node-core-library.md +++ b/websites/api.rushstack.io/docs/pages/node-core-library.md @@ -559,6 +559,17 @@ The options for [FileSystem.copyFiles()](./node-core-library.filesystem.copyfile The options for [FileSystem.createSymbolicLinkJunction()](./node-core-library.filesystem.createsymboliclinkjunction.md)<>, [FileSystem.createSymbolicLinkFile()](./node-core-library.filesystem.createsymboliclinkfile.md)<>, [FileSystem.createSymbolicLinkFolder()](./node-core-library.filesystem.createsymboliclinkfolder.md)<>, and [FileSystem.createHardLink()](./node-core-library.filesystem.createhardlink.md)<>. + + + +[IFileSystemCreateWriteStreamOptions](./node-core-library.ifilesystemcreatewritestreamoptions.md) + + + + +The options for [FileSystem.createWriteStream()](./node-core-library.filesystem.createwritestream.md) + + @@ -636,6 +647,16 @@ The options for [FileSystem.writeBuffersToFile()](./node-core-library.filesystem The options for [FileSystem.writeFile()](./node-core-library.filesystem.writefile.md) + + + +[IFileSystemWriteFileOptionsBase](./node-core-library.ifilesystemwritefileoptionsbase.md) + + + + + + @@ -1276,6 +1297,17 @@ Callback function type for [IFileSystemCopyFilesAsyncOptions.filter](./node-core Callback function type for [IFileSystemCopyFilesOptions.filter](./node-core-library.ifilesystemcopyfilesoptions.filter.md) + + + +[FileSystemReadStream](./node-core-library.filesystemreadstream.md) + + + + +An alias for the Node.js `fs.ReadStream` object. + + @@ -1287,6 +1319,17 @@ Callback function type for [IFileSystemCopyFilesOptions.filter](./node-core-libr An alias for the Node.js `fs.Stats` object. + + + +[FileSystemWriteStream](./node-core-library.filesystemwritestream.md) + + + + +An alias for the Node.js `fs.WriteStream` object. + +