Elide 1.0.0-alpha10 Help

Intro: Filesystem

Filesystem access with Elide

Coming soon.

Before you start

Before running the code below, you'll need to make sure the following is true:

  • Elide is installed

  • The elide binary is executable

  • The elide binary is on your PATH, or otherwise referenced in absolute form

Reading files from disk

We're going to try out Elide's isolation with regard to disk I/O

  1. Start an interactive session. Elide starts you with JavaScript. Let's also create a file which we will read:

    echo "testing" > hello.txt elide repl elide (js) >
  2. Now, let's import the node:fs module:

    elide (js) > const fs = require('node:fs');
  3. Let's read the file we just wrote:

    elide (js) > fs.readFileSync("hello.txt", {encoding: 'utf-8'}) testing

    Neat! We can read the file.

Last modified: 15 May 2024