Buckets:
| /** | |
| * @license | |
| * Copyright 2022 The Emscripten Authors | |
| * SPDX-License-Identifier: MIT | |
| */ | |
| // This implementation ensures that Windows-style paths are being | |
| // used when running on a Windows operating system - see: | |
| // https://nodejs.org/api/path.html#path_windows_vs_posix | |
| // It's only used/needed when linking with `-sNODERAWFS`, as that | |
| // will replace all normal filesystem access with direct Node.js | |
| // operations. Hence, using `nodePath` should be safe here. | |
| addToLibrary({ | |
| $nodePath: "require('node:path')", | |
| $PATH__deps: ['$nodePath'], | |
| $PATH: `{ | |
| isAbs: nodePath.isAbsolute, | |
| normalize: nodePath.normalize, | |
| dirname: nodePath.dirname, | |
| basename: nodePath.basename, | |
| join: nodePath.join, | |
| join2: nodePath.join, | |
| }`, | |
| // The FS-using parts are split out into a separate object, so simple path | |
| // usage does not require the FS. | |
| $PATH_FS__deps: ['$FS', '$nodePath'], | |
| $PATH_FS__docs: '/** @type{{resolve: function(...*)}} */', | |
| $PATH_FS: { | |
| resolve: (...paths) => { | |
| paths.unshift(FS.cwd()); | |
| return nodePath.posix.resolve(...paths); | |
| }, | |
| relative: (from, to) => nodePath.posix.relative(from || FS.cwd(), to || FS.cwd()), | |
| } | |
| }); | |
Xet Storage Details
- Size:
- 1.19 kB
- Xet hash:
- d4a8d3cd7c2536b25d124fe983ca4d60f861b8ac42c7be0e267314e7788c4207
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.