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:
The
elide
binary is executableThe
elide
binary is on yourPATH
, 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
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) >Now, let's import the
node:fs
module:elide (js) > const fs = require('node:fs');Let's read the file we just wrote:
elide (js) > fs.readFileSync("hello.txt", {encoding: 'utf-8'}) testingNeat! We can read the file.
Last modified: 15 May 2024