diff --git a/.gitignore b/.gitignore index b71d102..625dd68 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.dll *.so *.dylib +.idea # Test binary, built with `go test -c` *.test diff --git a/README.md b/README.md index ee2047a..f8fceb0 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # quickjs-go English | [简体中文](README_zh-cn.md) -[![Test](https://github.com/buke/quickjs-go/workflows/Test/badge.svg)](https://github.com/buke/quickjs-go/actions?query=workflow%3ATest) +Fork from https://github.com/buke/quickjs-go, fixed performance bug for function callback + +[![Test](https://apigo.cc/apigo/quickjs-go/workflows/Test/badge.svg)](https://apigo.cc/apigo/quickjs-go/actions?query=workflow%3ATest) [![codecov](https://codecov.io/gh/buke/quickjs-go/branch/main/graph/badge.svg?token=DW5RGD01AG)](https://codecov.io/gh/buke/quickjs-go) -[![Go Report Card](https://goreportcard.com/badge/github.com/buke/quickjs-go)](https://goreportcard.com/report/github.com/buke/quickjs-go) -[![GoDoc](https://pkg.go.dev/badge/github.com/buke/quickjs-go?status.svg)](https://pkg.go.dev/github.com/buke/quickjs-go?tab=doc) +[![Go Report Card](https://goreportcard.com/badge/apigo.cc/apigo/quickjs-go)](https://goreportcard.com/report/apigo.cc/apigo/quickjs-go) +[![GoDoc](https://pkg.go.dev/badge/apigo.cc/apigo/quickjs-go?status.svg)](https://pkg.go.dev/apigo.cc/apigo/quickjs-go?tab=doc) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fbuke%2Fquickjs-go.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fbuke%2Fquickjs-go?ref=badge_shield) Go bindings to QuickJS: a fast, small, and embeddable ES2020 JavaScript interpreter. @@ -50,7 +52,7 @@ we prebuilt quickjs static library for the following platforms: ## Usage ```go -import "github.com/buke/quickjs-go" +import "apigo.cc/apigo/quickjs-go" ``` ### Run a script @@ -60,7 +62,7 @@ package main import ( "fmt" - "github.com/buke/quickjs-go" + "apigo.cc/apigo/quickjs-go" ) func main() { @@ -94,7 +96,7 @@ package main import ( "fmt" - "github.com/buke/quickjs-go" + "apigo.cc/apigo/quickjs-go" ) func main() { @@ -123,7 +125,7 @@ func main() { ### Bind Go Funtion to Javascript async/sync function ```go package main -import "github.com/buke/quickjs-go" +import "apigo.cc/apigo/quickjs-go" func main() { // Create a new runtime @@ -191,7 +193,7 @@ package main import ( "fmt" - "github.com/buke/quickjs-go" + "apigo.cc/apigo/quickjs-go" ) func main() { @@ -221,7 +223,7 @@ package main import ( "fmt" - "github.com/buke/quickjs-go" + "apigo.cc/apigo/quickjs-go" ) func main() { @@ -268,7 +270,7 @@ package main import ( "fmt" - "github.com/buke/quickjs-go" + "apigo.cc/apigo/quickjs-go" ) func main() { @@ -300,7 +302,7 @@ package main import ( "fmt" - "github.com/buke/quickjs-go" + "apigo.cc/apigo/quickjs-go" ) func main() { @@ -337,7 +339,7 @@ func main() { ## Documentation -Go Reference & more examples: https://pkg.go.dev/github.com/buke/quickjs-go +Go Reference & more examples: https://pkg.go.dev/apigo.cc/apigo/quickjs-go ## License [MIT](./LICENSE) @@ -346,4 +348,4 @@ Go Reference & more examples: https://pkg.go.dev/github.com/buke/quickjs-go [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fbuke%2Fquickjs-go.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fbuke%2Fquickjs-go?ref=badge_large) ## Related Projects -* https://github.com/buke/quickjs-go-polyfill \ No newline at end of file +* https://apigo.cc/apigo/quickjs-go-polyfill \ No newline at end of file diff --git a/README_zh-cn.md b/README_zh-cn.md index 141e167..5310dd8 100644 --- a/README_zh-cn.md +++ b/README_zh-cn.md @@ -1,10 +1,12 @@ # quickjs-go [English](README.md) | 简体中文 -[![Test](https://github.com/buke/quickjs-go/workflows/Test/badge.svg)](https://github.com/buke/quickjs-go/actions?query=workflow%3ATest) +源自 https://github.com/buke/quickjs-go, 修复了函数回调时的性能问题 + +[![Test](https://apigo.cc/apigo/quickjs-go/workflows/Test/badge.svg)](https://apigo.cc/apigo/quickjs-go/actions?query=workflow%3ATest) [![codecov](https://codecov.io/gh/buke/quickjs-go/branch/main/graph/badge.svg?token=DW5RGD01AG)](https://codecov.io/gh/buke/quickjs-go) -[![Go Report Card](https://goreportcard.com/badge/github.com/buke/quickjs-go)](https://goreportcard.com/report/github.com/buke/quickjs-go) -[![GoDoc](https://pkg.go.dev/badge/github.com/buke/quickjs-go?status.svg)](https://pkg.go.dev/github.com/buke/quickjs-go?tab=doc) +[![Go Report Card](https://goreportcard.com/badge/apigo.cc/apigo/quickjs-go)](https://goreportcard.com/report/apigo.cc/apigo/quickjs-go) +[![GoDoc](https://pkg.go.dev/badge/apigo.cc/apigo/quickjs-go?status.svg)](https://pkg.go.dev/apigo.cc/apigo/quickjs-go?tab=doc) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fbuke%2Fquickjs-go.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fbuke%2Fquickjs-go?ref=badge_shield) Go 语言的QuickJS绑定库:快速、小型、可嵌入的ES2020 JavaScript解释器。 @@ -51,7 +53,7 @@ Go 语言的QuickJS绑定库:快速、小型、可嵌入的ES2020 JavaScript ## 用法 ```go -import "github.com/buke/quickjs-go" +import "apigo.cc/apigo/quickjs-go" ``` ### 执行javascript脚本 @@ -61,7 +63,7 @@ package main import ( "fmt" - "github.com/buke/quickjs-go" + "apigo.cc/apigo/quickjs-go" ) func main() { @@ -95,7 +97,7 @@ package main import ( "fmt" - "github.com/buke/quickjs-go" + "apigo.cc/apigo/quickjs-go" ) func main() { @@ -124,7 +126,7 @@ func main() { ### 函数绑定 ```go package main -import "github.com/buke/quickjs-go" +import "apigo.cc/apigo/quickjs-go" func main() { // Create a new runtime @@ -192,7 +194,7 @@ package main import ( "fmt" - "github.com/buke/quickjs-go" + "apigo.cc/apigo/quickjs-go" ) func main() { @@ -222,7 +224,7 @@ package main import ( "fmt" - "github.com/buke/quickjs-go" + "apigo.cc/apigo/quickjs-go" ) func main() { @@ -269,7 +271,7 @@ package main import ( "fmt" - "github.com/buke/quickjs-go" + "apigo.cc/apigo/quickjs-go" ) func main() { @@ -302,7 +304,7 @@ package main import ( "fmt" - "github.com/buke/quickjs-go" + "apigo.cc/apigo/quickjs-go" ) func main() { @@ -338,7 +340,7 @@ func main() { ``` ## 文档 -Go 语言文档和示例: https://pkg.go.dev/github.com/buke/quickjs-go +Go 语言文档和示例: https://pkg.go.dev/apigo.cc/apigo/quickjs-go ## 协议 [MIT](./LICENSE) @@ -347,4 +349,4 @@ Go 语言文档和示例: https://pkg.go.dev/github.com/buke/quickjs-go [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fbuke%2Fquickjs-go.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fbuke%2Fquickjs-go?ref=badge_large) ## 相关项目 -* https://github.com/buke/quickjs-go-polyfill \ No newline at end of file +* https://apigo.cc/apigo/quickjs-go-polyfill \ No newline at end of file diff --git a/go.mod b/go.mod index 8771d8c..17d0851 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/buke/quickjs-go +module apigo.cc/apigo/quickjs-go go 1.20 diff --git a/quickjs_test.go b/quickjs_test.go index bb0edc0..b9051bd 100644 --- a/quickjs_test.go +++ b/quickjs_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/buke/quickjs-go" + "apigo.cc/apigo/quickjs-go" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" )