{"id":18559228,"url":"https://github.com/linux-china/kotlin-deno-example","last_synced_at":"2026-03-10T17:33:23.684Z","repository":{"id":136595662,"uuid":"294895996","full_name":"linux-china/kotlin-deno-example","owner":"linux-china","description":"🦕Deno app development with Kotlin","archived":false,"fork":false,"pushed_at":"2020-09-13T21:32:47.000Z","size":137,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-08T23:47:56.779Z","etag":null,"topics":["deno","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/linux-china.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,"publiccode":null,"codemeta":null}},"created_at":"2020-09-12T07:44:16.000Z","updated_at":"2025-02-02T18:36:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"865b9e39-173a-461b-a13e-4fc07b6bd5df","html_url":"https://github.com/linux-china/kotlin-deno-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/linux-china/kotlin-deno-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fkotlin-deno-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fkotlin-deno-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fkotlin-deno-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fkotlin-deno-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linux-china","download_url":"https://codeload.github.com/linux-china/kotlin-deno-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fkotlin-deno-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30344450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["deno","kotlin"],"created_at":"2024-11-06T21:42:20.307Z","updated_at":"2026-03-10T17:33:23.667Z","avatar_url":"https://github.com/linux-china.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"Kotlin Deno example\n===================\n🦕Deno development with Kotlin.\n\n# Features\n\n* Deno completion:  convert lib.deno.d.ts to  Kotlin declarations\n\n# How it work?\n\n* Compile kotlin into Javascript with nodejs target\n* Append stub for Deno for compiled JS code like following.\n\n```javascript\n// ========stub for Deno=======\nimport Kotlin from \"https://jspm.dev/kotlin@1.4.0\"\n\nconst module = {\n    exports: {}\n};\n\nfunction require(moduleName) {\n    if (moduleName === 'kotlin') {\n        return Kotlin\n    } else {\n        return {};\n    }\n}\n\n// ====== compiled JS code from Kotlin======\n\n(function (_, Kotlin) {\n   // ...\n}(module.exports, require('kotlin')));\n\nexport default module.exports;\n```\n\n* Build the project\n\n```\n$ ./gradlew deno\n```\n\n* Run the code with Deno. Please add --no-check for Deno run to disable kotlin module check.\n\n```\n$ deno run --no-check build/deno/kotlin-deno-example.js\n```\n\n# How to invoke Deno stdlib?\n\n* Declare \"external fun\" for Kotlin in src/main/kotlin/deno/lib.std.kt\n* Add imports in \"buildSrc/src/scripts/deps.js\"\n\n# Import other npm packages or Deno modules\n\n* Use dukat to generate Kotlin declarations from xxx.d.ts or maintain lib.xxx.kt manually\n* import Deno modules in deps.js\n* import npm packages in deps.js by https://jspm.dev/xxx@version\n\n# Use Kotlinx Coroutines library\n\n* add dependency in build.gradle.kts\n\n```\nimplementation(\"org.jetbrains.kotlinx\", \"kotlinx-coroutines-core\", \"1.3.9\")\n```\n\n* Add kotlinx-coroutines-core import in templates.js\n\n```javascript\nimport Kotlin from \"https://jspm.dev/kotlin@1.4.0\"\nimport KotlinxCoroutinesCore from \"https://jspm.dev/kotlinx-coroutines-core@1.3.9\"\n\n//......\n\nfunction require(moduleName) {\n  if (moduleName === 'kotlin') {\n    return Kotlin\n  } else if (moduleName === 'kotlinx-coroutines-core') {\n    return KotlinxCoroutinesCore;\n  } else {\n    return {};\n  }\n}\n```\n\n# Kotlin/JS IR compiler\nAs of Kotlin 1.4.0, the Kotlin/JS IR compiler has Alpha stability level.\nWith Kotlin/JS IR compiler support, and and compiled JS code is more clean.\n\n# Use cases\n\n* Kotlin Deno App\n* Kotlin as library: TypeScript to invoke JavaScript code compiled by Kotlin\n\n# Dev Tips\n\n* Enables continuous build: re-execute tasks when task file inputs change\n\n```\n$ ./gradlew -t deno\n```\n\n* deno run --watch flags to watch file changes. Deno 1.4.0+ required\n\n```\n$ deno run --unstable --watch --allow-read --no-check build/deno/kotlin-deno-example.js\n```\n\n# References\n\n* Deno: https://deno.land/\n* Kotlin: https://kotlinlang.org/\n* lib.deno.d.ts: https://github.com/denoland/deno/releases/latest/download/lib.deno.d.ts\n* dukat: Converter of TypeScript definition files to Kotlin declarations https://github.com/Kotlin/dukat\n* jspm: provides a module CDN allowing any package from npm to be directly loaded in the browser and other JS environments https://jspm.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Fkotlin-deno-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinux-china%2Fkotlin-deno-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Fkotlin-deno-example/lists"}