Skip to content

Commit

Permalink
docs: add documents for getBrowserFS
Browse files Browse the repository at this point in the history
  • Loading branch information
arianrhodsandlot committed Mar 3, 2024
1 parent 846a96a commit 9d5e404
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- add support for cancelling a launch via an `AbortController`
- add `beforeLaunch` and `onLaunch` parameters to allow us to hook into the launching process
- add `getBrowserFS` method for accessing the corresponding `BFSEmscriptenFS` object of the emulator

## [0.8.1](https://github.com/arianrhodsandlot/nostalgist/compare/v0.8.0...v0.8.1) - 2024-02-24

Expand Down
16 changes: 16 additions & 0 deletions docs/src/content/docs/apis/get-browser-fs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: getBrowserFS
---

Get the `BFSEmscriptenFS` object of the current running emulator.

See [BFSEmscriptenFS](https://jvilk.com/browserfs/1.4.1/classes/_generic_emscripten_fs_.bfsemscriptenfs.html) for more information.

## Usage
```js
const nostalgist = await Nostalgist.nes('flappybird.nes')

const browserFS = await nostalgist.getBrowserFS()
const nodeFS = browserFS.getNodeFS()
nodeFS.readdirSync('/')
```
2 changes: 1 addition & 1 deletion docs/src/content/docs/apis/get-emscripten-fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: getEmscriptenFS
---

Get the Emscripten FS object of the current running emulator.
Get the Emscripten `FS` object of the current running emulator.

See [FS object](https://emscripten.org/docs/api_reference/Filesystem-API.html#id2) for more information.

Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/apis/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ title: API reference
+ [`launchEmulator`](/apis/launch-emulator) (advanced)
+ [`getEmscriptenModule`](/apis/get-emscripten-module) (advanced)
+ [`getEmscriptenFS`](/apis/get-emscripten-fs) (advanced)
+ [`getBrowserFS`](/apis/get-browser-fs) (advanced)
+ [`pressDown`](/apis/press-down) (advanced)
+ [`pressUp`](/apis/press-up) (advanced)

0 comments on commit 9d5e404

Please sign in to comment.