MCPcopy
hub / github.com/pocketbase/pocketbase / BindOS

Function BindOS

plugins/jsvm/binds.go:806–830  ·  view source on GitHub ↗

BindOS registers $os.* namespaced object with common std Go os package related exports. See https://pocketbase.io/jsvm/modules/_os.html.

(vm *goja.Runtime)

Source from the content-addressed store, hash-verified

804//
805// See https://pocketbase.io/jsvm/modules/_os.html.
806func BindOS(vm *goja.Runtime) {
807 obj := vm.NewObject()
808 vm.Set("$os", obj)
809
810 obj.Set("args", os.Args)
811 obj.Set("exec", exec.Command) // @deprecated
812 obj.Set("cmd", exec.Command)
813 obj.Set("exit", os.Exit)
814 obj.Set("getenv", os.Getenv)
815 obj.Set("dirFS", os.DirFS)
816 obj.Set("stat", os.Stat)
817 obj.Set("readFile", os.ReadFile)
818 obj.Set("writeFile", os.WriteFile)
819 obj.Set("readDir", os.ReadDir)
820 obj.Set("tempDir", os.TempDir)
821 obj.Set("truncate", os.Truncate)
822 obj.Set("getwd", os.Getwd)
823 obj.Set("mkdir", os.Mkdir)
824 obj.Set("mkdirAll", os.MkdirAll)
825 obj.Set("rename", os.Rename)
826 obj.Set("remove", os.Remove)
827 obj.Set("removeAll", os.RemoveAll)
828 obj.Set("openRoot", os.OpenRoot)
829 obj.Set("openInRoot", os.OpenInRoot)
830}
831
832// BindForms registers various application form constructors.
833// These bindings are mostly used internally and/or preserved for backward compatibility with earlier versions.

Callers 3

TestBindOSCountFunction · 0.85
registerMigrationsMethod · 0.85
registerHooksMethod · 0.85

Calls 1

SetMethod · 0.65

Tested by 1

TestBindOSCountFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…