Skip to content

Commit ba2a7c4

Browse files
committed
feat: mode support in mkdirs and writeFile when using node ws
1 parent 7954a04 commit ba2a7c4

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ You can then continue with installation instructions, usage, and other sections
3939
* [Usage in browser](#usage-in-browser)
4040
* [Usage in web-worker in browser](#usage-in-web-worker-in-browser)
4141
* [Usage in Tauri](#usage-in-tauri)
42+
* [Usage in Tauri with Node Websocket Connector](#usage-in-tauri-with-node-websocket-connector)
43+
* [Example: Setting Up Your Own `phoenix-fs` Server in Node.js](#example-setting-up-your-own-phoenix-fs-server-in-nodejs)
4244
* [Development](#development)
4345
* [Tests in Browser](#tests-in-browser)
4446
* [Tests in tauri](#tests-in-tauri)
@@ -91,6 +93,9 @@ You can then continue with installation instructions, usage, and other sections
9193
* [`fs.writeFile(path, data, options?, callback)` Function](#fswritefilepath-data-options-callback-function)
9294
* [Parameters:](#parameters-7)
9395
* [Example:](#example-2)
96+
* [`fs.setNodeWSEndpoint(websocketEndpoint)`](#fssetnodewsendpointwebsocketendpoint)
97+
* [`fs.forceUseNodeWSEndpoint(use)`](#fsforceusenodewsendpointuse)
98+
* [`fs.preferNodeWSEndpoint(use)`](#fsprefernodewsendpointuse)
9499
<!-- TOC -->
95100

96101
## Installation
@@ -566,7 +571,7 @@ Creates a directory at given path. Not that the parent dir should exist for this
566571

567572
- **Parameters:**
568573
- `path` _(string)_ - The path where the directory should be created.
569-
- `mode` _(number|function)_ (Optional, default: `0o666`) - The directory permissions.
574+
- `mode` _(number|function)_ (Optional, default: `0o777`) - The directory permissions.
570575
- `callback` _(function)_ (Optional) - Callback to execute once directory creation is done. Called with an error as the first argument on failure, and null on success.
571576

572577
- **Examples:**

dist/virtualfs.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/virtualfs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/fslib_tauri.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ function readdir(path, options, callback) {
285285
* Creates a directory with optional mode and recursion(create all intermediate directories if those don't exist).
286286
*
287287
* @param {string} path - The path where the directory should be created.
288-
* @param {(number)} [mode=0o666] - The directory permissions. Defaults to `0o666` if not provided.
288+
* @param {(number)} [mode=0o777] - The directory permissions. Defaults to `0o777` if not provided.
289289
* @param {(boolean)} [recursive=false] - Whether to create directories recursively. Defaults to `false` if not provided.
290290
* @param {function} [callback] - Callback to execute once directory creation is done. Called with an error as the first argument on failure, and null on success.
291291
*
@@ -309,7 +309,7 @@ function mkdirs(path, mode, recursive, callback) {
309309
if (typeof mode !== 'number') {
310310
callback = recursive;
311311
recursive = mode;
312-
mode = 0o666; // Default mode (or any other default you'd like to set)
312+
mode = 0o777; // Default mode (or any other default you'd like to set)
313313
}
314314

315315
// Determine if 'recursive' is provided

0 commit comments

Comments
 (0)