{"id":13782527,"url":"https://github.com/tiagosr/ofxDuktape","last_synced_at":"2025-05-11T15:32:35.449Z","repository":{"id":34682065,"uuid":"38655813","full_name":"tiagosr/ofxDuktape","owner":"tiagosr","description":"Addon for openFrameworks with bindings to the Duktape Javascript interpreter","archived":false,"fork":false,"pushed_at":"2023-02-01T23:05:53.000Z","size":2608,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-17T17:43:22.945Z","etag":null,"topics":["duktape","javascript-interpreter","openframeworks-addon"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiagosr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-07-07T01:17:18.000Z","updated_at":"2023-09-07T18:38:15.000Z","dependencies_parsed_at":"2024-04-24T11:52:02.391Z","dependency_job_id":"6dee0eaf-39a0-475e-8568-2e030857e829","html_url":"https://github.com/tiagosr/ofxDuktape","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/tiagosr%2FofxDuktape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiagosr%2FofxDuktape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiagosr%2FofxDuktape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiagosr%2FofxDuktape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiagosr","download_url":"https://codeload.github.com/tiagosr/ofxDuktape/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253588753,"owners_count":21932319,"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":["duktape","javascript-interpreter","openframeworks-addon"],"created_at":"2024-08-03T18:01:38.571Z","updated_at":"2025-05-11T15:32:34.360Z","avatar_url":"https://github.com/tiagosr.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# ofxDuktape\n\nopenFrameworks addon with bindings to the [Duktape](http://www.duktape.org) Javascript interpreter\n\nThis addon is distributed under the terms of the MIT License.\n\n## Usage\n\n```c++\n#include \"ofxDuktape.h\"\n\n// create a duktape context anywhere\nofxDuktape duk;\n\n// use it in your code\nint retcode = duk.pEval(\"log(\\\"hello openFrameworks!\\\"\");\n\n// pEval returns 0 if code was executed correctly, and other values for errors\nif (!retcode) {\n  // -1 is the index to the last object stored in duktape's stack, i.e. the result of the call\n  ofLogInfo() \u003c\u003c \"return value is \" \u003c\u003c duk.safeToString(-1);\n} else {\n  ofLogError() \u003c\u003c \"error while executing javascript\";\n}\n```\n\n## Extensions\n\nThe header file ```ofxDukOFBindings.h``` has most of openFrameworks 0.9 API implemented inside the ```of``` object,\nand a lot of syntactic sugar - ofSetXXX methods with single parameters and ofGetXXX methods are mostly implemented as properties\n\n```c++\n#include \"ofxDukOFBindings.h\"\nofxDuktape duk;\n\n// setup the 'of' object in the javascript context\nofxDukBindings::setup(duk);\n\n// interact with openFrameworks\nduk.pEval(\"of.windowTitle = \\\"New window title\\\"\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiagosr%2FofxDuktape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiagosr%2FofxDuktape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiagosr%2FofxDuktape/lists"}