Published
Edited
Mar 12, 2021
5 stars
Insert cell
Insert cell
Insert cell
FS = require("https://unpkg.com/@isomorphic-git/lightning-fs@4.4.1")
Insert cell
git = require("https://unpkg.com/isomorphic-git@1.8.1")
Insert cell
http = import("https://unpkg.com/isomorphic-git@beta/http/web/index.js")
Insert cell
Insert cell
fs = new FS("testfs")
Insert cell
pfs = fs.promises
Insert cell
Insert cell
pfs.mkdir("/foo") //EEXIST if opening this page again, FS persists to IndexedDB!
Insert cell
pfs.stat("/foo")
Insert cell
pfs.writeFile('/foo/filename.txt', 'Hello')
Insert cell
pfs.readFile('/foo/filename.txt', { encoding: 'utf8' })
Insert cell
pfs.du('/foo')
Insert cell
Insert cell
git.clone({
fs,
http,
dir: "/runtime",
corsProxy: 'https://cors.isomorphic-git.org',
url: 'https://github.com/observablehq/runtime',
ref: 'master',
singleBranch: true,
depth: 10
})
Insert cell
pfs.readFile("/runtime/README.md", "utf8").then(d => md`${d}`)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more