console/README.md

57 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2024-10-11 10:27:30 +08:00
# console for GoJS
2024-10-11 10:14:56 +08:00
## usage
```go
import (
2024-10-11 10:27:30 +08:00
"apigo.cc/gojs"
_ "apigo.cc/gojs/console"
2024-10-11 10:14:56 +08:00
)
func main() {
2024-10-11 10:27:30 +08:00
r, err := gojs.Run(`
import console from 'apigo.cc/gojs/console'
2024-10-11 10:14:56 +08:00
function main(args){
2024-10-11 10:27:30 +08:00
console.info('hello 123')
2024-10-11 10:14:56 +08:00
}
2024-10-11 10:27:30 +08:00
`, "test.js")
2024-10-11 10:14:56 +08:00
2024-10-11 10:27:30 +08:00
fmt.Println(r, err)
2024-10-11 10:14:56 +08:00
}
```
## module.exports
```ts
2024-10-11 10:27:30 +08:00
function print(...data: any[]): void {}
function println(...data: any[]): void {}
function log(...data: any[]): void {}
function debug(...data: any[]): void {}
function info(...data: any[]): void {}
function warn(...data: any[]): void {}
function error(...data: any[]): void {}
function input(...data: any[]): string {return ''}
function black(...data: any[]): string {return ''}
function red(...data: any[]): string {return ''}
function green(...data: any[]): string {return ''}
function yellow(...data: any[]): string {return ''}
function blue(...data: any[]): string {return ''}
function magenta(...data: any[]): string {return ''}
function cyan(...data: any[]): string {return ''}
function white(...data: any[]): string {return ''}
function dim(...data: any[]): string {return ''}
function italic(...data: any[]): string {return ''}
function bBlack(...data: any[]): string {return ''}
function bRed(...data: any[]): string {return ''}
function bGreen(...data: any[]): string {return ''}
function bYellow(...data: any[]): string {return ''}
function bBlue(...data: any[]): string {return ''}
function bMagenta(...data: any[]): string {return ''}
function bCyan(...data: any[]): string {return ''}
function bWhite(...data: any[]): string {return ''}
2024-10-11 10:14:56 +08:00
```
2024-10-11 10:39:10 +08:00
## full api see [console.ts](https://apigo.cc/gojs/console/console.ts)