Skip to content
On this page

๐Ÿ“‚ @bridge/com-mojang

This module allows access to the com.mojang file system. View Source Code

js
import { ... } from "@bridge/com-mojang"

๐Ÿ’ผ Variables

setup

A signal that states whether the com.mojang folder has been setup by the user.

  • Type: Signal<void>
js
// Wait for the com.mojang folder to be setup before interacting with it
await setup.fired
// ...

// Check that the com.mojang folder has already been setup
if (setup.hasFired) {
	console.log('com.mojang linking has been setup')
}

โšก Functions

requestFileSystem

The requestFileSystem function returns the com.mojang file system instance.

  • Signature: requestFileSystem()
  • Returns: Promise<FileSystem>
js
const comMojangFs = await requestFileSystem()

if (await comMojangFs.directoryExists('test')) {
	console.log('The folder "test" exists in the com.mojang folder.')
}

TIP

This file system instance will have the same methods as the @bridge/fs module, except for the onBridgeFolderSetup method.

Released under the GPL-3.0 License.