{"id":13724083,"url":"https://github.com/wspl/go-quickjs","last_synced_at":"2025-10-27T01:31:06.643Z","repository":{"id":57494842,"uuid":"196805110","full_name":"wspl/go-quickjs","owner":"wspl","description":"QuickJS bindings for Go","archived":false,"fork":false,"pushed_at":"2022-08-26T03:46:16.000Z","size":1625,"stargazers_count":157,"open_issues_count":1,"forks_count":21,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-14T13:37:24.671Z","etag":null,"topics":["go","golang","javascript","quickjs"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wspl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-14T07:05:10.000Z","updated_at":"2024-10-25T15:20:36.000Z","dependencies_parsed_at":"2022-08-28T19:40:33.266Z","dependency_job_id":null,"html_url":"https://github.com/wspl/go-quickjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wspl%2Fgo-quickjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wspl%2Fgo-quickjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wspl%2Fgo-quickjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wspl%2Fgo-quickjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wspl","download_url":"https://codeload.github.com/wspl/go-quickjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238418463,"owners_count":19468917,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","javascript","quickjs"],"created_at":"2024-08-03T01:01:49.833Z","updated_at":"2025-10-27T01:31:01.317Z","avatar_url":"https://github.com/wspl.png","language":"Go","readme":"# go-quickjs\nQuickJS engine bindings for Go.\n\n**Warning: At present, both the original project `quickjs` and this project are still in the early stage of development. Please use this project carefully in the production environment.**\n\n## Features\n* Evaluate script\n* Evaluate bytecode in `[]byte`\n* Compile script into bytecode in `[]byte`\n* Simple exception throwing and catching\n* Invoke Go function from JavaScript\n* Operate JavaScript values and objects in Go\n\n## Get Started\nInstall: (MacOS tested only)\n```bash\nwget https://raw.github.com/wspl/go-quickjs/master/install.sh \u0026\u0026 sh ./install.sh\n```\nHello world:\n```go\npackage main\n\nimport \"github.com/wspl/go-quickjs\"\n\nfunc main() {\n\truntime := quickjs.NewJSRuntime()\n\tdefer runtime.Free()\n\tcontext := runtime.NewContext()\n\tdefer context.Free()\n\n\tret, err := context.Eval(\"'Hello ' + 'World!'\", \"\")\n\tif err != nil {\n\t\tprintln(err.Message())\n\t}\n\tprintln(ret.String())\n}\n```\nInvoke Go function in JavaScript:\n```go\npackage main\n\nimport . \"github.com/wspl/go-quickjs\"\n\nfunc main() {\n\truntime := NewJSRuntime()\n\tdefer runtime.Free()\n\tcontext := runtime.NewContext()\n\tdefer context.Free()\n\n\tfn := context.NewGoFunction(func(args []*JSValue, this *JSValue) (*JSValue, *JSError) {\n\t\tprintln(\"Invoked!\")\n\t\treturn context.NewString(\"Hello World\"), nil\n\t})\n\tfn.Value().Expose(\"hello\")\n\tret, err := context.Eval(\"hello()\", \"\")\n\tif err != nil {\n\t\tprintln(err.Message())\n\t}\n\tprintln(ret.String())\n}\n\n```\n\n## TODOs\n- Test cases\n- Module support\n- Fix bugs\n\n## License\n[MIT](./LICENSE)","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwspl%2Fgo-quickjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwspl%2Fgo-quickjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwspl%2Fgo-quickjs/lists"}