mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 21:45:26 +00:00
35 lines
613 B
Go
35 lines
613 B
Go
|
|
package fs
|
||
|
|
|
||
|
|
import (
|
||
|
|
lib_fs "github.com/projectdiscovery/nuclei/v2/pkg/js/libs/fs"
|
||
|
|
|
||
|
|
"github.com/dop251/goja"
|
||
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/js/gojs"
|
||
|
|
)
|
||
|
|
|
||
|
|
var (
|
||
|
|
module = gojs.NewGojaModule("nuclei/fs")
|
||
|
|
)
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
module.Set(
|
||
|
|
gojs.Objects{
|
||
|
|
// Functions
|
||
|
|
"ListDir": lib_fs.ListDir,
|
||
|
|
"ReadFile": lib_fs.ReadFile,
|
||
|
|
"ReadFileAsString": lib_fs.ReadFileAsString,
|
||
|
|
"ReadFilesFromDir": lib_fs.ReadFilesFromDir,
|
||
|
|
|
||
|
|
// Var and consts
|
||
|
|
|
||
|
|
// Types (value type)
|
||
|
|
|
||
|
|
// Types (pointer type)
|
||
|
|
},
|
||
|
|
).Register()
|
||
|
|
}
|
||
|
|
|
||
|
|
func Enable(runtime *goja.Runtime) {
|
||
|
|
module.Enable(runtime)
|
||
|
|
}
|