Documentation
¶
Index ¶
- type Module
- func (m *Module) Chdir(name string) error
- func (m *Module) Close()
- func (m *Module) Cwd() string
- func (m *Module) Load(vm *goja.Runtime, module *goja.Object)
- func (m *Module) OpenFileCount() int
- func (m *Module) ReadSource(name string) ([]byte, error)
- func (m *Module) Resolve(name string, allowMissing bool) (string, error)
- func (m *Module) SetExternalFileLookup(lookup func(int) (*os.File, bool))
- func (m *Module) SetFileHooks(onOpen func(int, *os.File, uint64), onClose func(int))
- func (m *Module) WriteResolved(path string, data []byte, mode os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func New ¶
func New(runtime *bridge.Runtime, root, cwd string, extraRoots []string, allowAllFileAccess bool) (*Module, error)
New creates the filesystem module confined to root (BaseDir) plus any extra roots. When allowAllFileAccess is true every root is opened but ignored so paths resolve against the real filesystem.
func (*Module) OpenFileCount ¶
func (*Module) ReadSource ¶
ReadSource loads a CommonJS source file through the same rooted filesystem handle used by fs, preventing path validation and file opening from racing.
func (*Module) SetExternalFileLookup ¶
func (*Module) SetFileHooks ¶
Click to show internal directories.
Click to hide internal directories.