main
Raw Download raw file
 1//go:build js
 2// +build js
 3
 4package osfs
 5
 6import (
 7	"github.com/go-git/go-billy/v5"
 8	"github.com/go-git/go-billy/v5/helper/chroot"
 9	"github.com/go-git/go-billy/v5/memfs"
10)
11
12// globalMemFs is the global memory fs
13var globalMemFs = memfs.New()
14
15// Default Filesystem representing the root of in-memory filesystem for a
16// js/wasm environment.
17var Default = memfs.New()
18
19// New returns a new OS filesystem.
20func New(baseDir string, _ ...Option) billy.Filesystem {
21	return chroot.New(Default, Default.Join("/", baseDir))
22}
23
24type options struct {
25}