Go to file
2024-10-26 22:12:41 +08:00
.gitignore 1 2024-10-11 12:02:48 +08:00
file_test.go 1 2024-10-11 12:02:48 +08:00
file.go add exists 2024-10-26 22:12:41 +08:00
file.ts add exists 2024-10-26 22:12:41 +08:00
go.mod add exists 2024-10-26 22:12:41 +08:00
LICENSE 1 2024-10-11 12:02:48 +08:00
README.md 1 2024-10-11 12:02:48 +08:00

file for GoJS

usage

import (
	"apigo.cc/gojs"
	_ "apigo.cc/gojs/file"
)

func main() {
	r, err := gojs.Run(`
import file from 'apigo.cc/gojs/file'

function main(args){
	return file.read('test.txt')
}
	`, "test.js")

    fmt.Println(r, err)
}

cache file for proformance

import file from 'apigo.cc/gojs/file'
file.cache('test.txt', true)
file.cache('images/test.png')

module.exports

function read(filename: string): string {return ''}
function readBytes(filename: string): any {return null}
function write(filename: string, data: any): void {}
function dir(filename: string): Array<FileInfo> {return null as any}
function stat(filename: string): FileInfo {return null as any}
function find(filename: string): string {return ''}
function remove(filename: string): void {}
function rename(from: string, to: string): void {}
function copy(from: string, to: string): void {}
function cache(filename: string, isCompress: boolean): void {}

full api see file.ts