{"id":21406504,"url":"https://github.com/forge-srl/bionic-js","last_synced_at":"2025-07-14T00:32:33.411Z","repository":{"id":38853019,"uuid":"314199832","full_name":"Forge-Srl/bionic-js","owner":"Forge-Srl","description":"Share JavaScript business logic in other languages.","archived":false,"fork":false,"pushed_at":"2023-03-05T16:53:15.000Z","size":2963,"stargazers_count":11,"open_issues_count":7,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-11T22:46:16.965Z","etag":null,"topics":["android","bionic-js","ios","java","javascript","node-js","swift"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Forge-Srl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-11-19T09:34:47.000Z","updated_at":"2025-05-07T10:41:16.000Z","dependencies_parsed_at":"2024-11-22T16:50:34.232Z","dependency_job_id":null,"html_url":"https://github.com/Forge-Srl/bionic-js","commit_stats":{"total_commits":228,"total_committers":6,"mean_commits":38.0,"dds":"0.42105263157894735","last_synced_commit":"2374940b140ca7def94dc773927a8221fc292534"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Forge-Srl/bionic-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Forge-Srl%2Fbionic-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Forge-Srl%2Fbionic-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Forge-Srl%2Fbionic-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Forge-Srl%2Fbionic-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Forge-Srl","download_url":"https://codeload.github.com/Forge-Srl/bionic-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Forge-Srl%2Fbionic-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265227898,"owners_count":23731059,"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":["android","bionic-js","ios","java","javascript","node-js","swift"],"created_at":"2024-11-22T16:40:19.834Z","updated_at":"2025-07-14T00:32:32.128Z","avatar_url":"https://github.com/Forge-Srl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg style=\"max-height: 250px;\" alt=\"bionic.js\" src=\"./bionic.js.svg\"\u003e\n\n![Build bionic.js Tool](https://github.com/Forge-Srl/bionic-js/workflows/Build%20bionic.js%20Tool/badge.svg?branch=main) ![Build bionic.js Java](https://github.com/Forge-Srl/bionic-js-runtime-java/workflows/Build%20bionic.js%20Java/badge.svg?branch=main) ![Build bionic.js Swift](https://github.com/Forge-Srl/bionic-js-runtime-swift/workflows/Build%20bionic.js%20Swift/badge.svg?branch=main)\n\u003c/div\u003e\n\u003cbr\u003e\n\n# bionic.js\n\nbionic.js let you use JavaScript classes from other programming languages without using any framework and without writing a single line of bridging code.\n\n1. write standard JavaScript code\n2. add type annotations for some JS classes and methods\n3. use these JS classes and methods from other languages like Java and Swift\n\n\n```javascript\n/* HelloJsWorld.js - JS reusable code */\n\nexport class HelloJsWorld {\n    \n    // @bionic String\n    static get hello() {\n        return \"Hello from JavaScript\"\n    }\n}\n```\n\n```java\n/* main.java - Java code */\n\npublic static void main (String[] args) {\n  System.out.println(HelloJsWorld.hello()) // Yes, I'm using the JS class from Java!\n}\n```\n\n```swift\n/* ContentView.swift - iOS code */\n\nimport SwiftUI\n\nstruct ContentView: View {\n    var body: some View {\n        Text(HelloJsWorld.hello!) // Yes, I'm using the JS class from Swift!\n            .padding()\n    }\n}\n```\n\n## Table of Contents\n\n- [Full Documentation](DOCUMENTATION.md)\n- [Getting started](TUTORIAL.md)\n- [Philosophy](#philosophy)\n- [Why should I use bionic.js?](#why-should-i-use-bionicjs)\n- [Installation](#installation)\n  - [CLI bundler](#cli-bundler)\n  - [Language runtimes](#language-runtimes)\n- [Usage](#usage)\n- [Supported languages](#supported-languages)\n- [License](#license)\n\n\n## Philosophy\n\nInstead of providing *yet another cross-platform app development framework*, bionic.js focuses on the **interoperability between JavaScript and other programming languages**, starting from languages used for the development of native apps.\n\nWriting native applications requires every aspect, including business logic, to be implemented twice in different languages such as Java or Swift. \nThe same business logic is often written again a third time for a web application.\nThe reuse of code between different languages is very limited and leads to several well-known problems.\n\nOn the other hand cross-platform app development frameworks enable great code reuse across platforms, but they are not loved by all developers as they force almost all the application code to be written in a common language such as JavaScript, C# or Dart, using a set of third party APIs not officially supported and maintained by each platform vendor.\n \nbionic.js loves both native application development and code reuse, leaving the native app developer the freedom to decide which code to reuse, when to do it, and how to do it.\n\n\n## Why should I use bionic.js?\n\n- [X] to keep an application truly native, maintainable by any native app developer\n- [X] to choose precisely which business logic I want to reuse between Android, iOS, backend and web apps\n- [X] to keep the codebase independent of a third party cross-platform app development framework\n- [X] to keep using native application tools and languages in order to develop and optimize every critical part (e.g. UI, multimedia, camera, sensors, GPU, crypto, biometrics, notifications, ...)\n- [X] to avoid writing and maintaining tons of bridging code between JavaScript and compiled code\n- [X] to keep trying all the new features offered by the latest versions of Android, iOS, macOS right away\n- [X] to keep using a large number of available and widely tested native libraries, also from JS code\n- [X] to put only the necessary code in the app binary, keeping the final package size under control\n- [X] to incrementally extract and reuse business logic from existent native apps without having to rewrite everything from scratch.\n\n\n## Installation\n\nbionic.js consists of a CLI bundler and a small library for each supported native language.\n\n### CLI bundler\n\nbionic.js bundler requires [node](https://nodejs.org/en/download/), once node is installed run\n\n```bash\nnpm install -g bionic-js-tool\n```\n\nFor more information see also the specific [tool documentation](bionic-js-tool/README.md).\n\n### Language runtimes\n\nEach language has its own way of adding a dependency. You should check each specific documentation:\n- [Java](https://github.com/Forge-Srl/bionic-js-runtime-java)\n- [Swift](https://github.com/Forge-Srl/bionic-js-runtime-swift)\n\n\n## Usage\n\n```shell\nbionicjs sync config-file.js\n```\n\nexample\n\n```console\nfoo@bar:~$ bionicjs sync hello-world.bjsconfig.js\nbionic.js - v0.1.0\n\nAnalyzing guest files dependencies\nExtracting schemas from guest files\nGenerating bundles\n\nOpening Swift host project\nWriting bundles\nWriting host files\nWriting Swift host project\n\nProject files\n [+] Bundle \"MainBundle\"\n [+] Source \"BjsMainBundle/BjsHelloJsWorld.swift\" - in bundles (MainBundle)\n [+] Source \"HelloJsWorld.swift\" - in bundles (MainBundle)\n [+] Source \"HelloNativeWorldBjsWrapper.swift\" - in bundles (MainBundle)\n [+] Source \"HelloWorld.swift\" - in bundles (MainBundle)\n ----------\n [-] deleted : 0\n [U] updated : 0\n [+] added : 5\n\nOpening Java host project\nWriting bundles\nWriting host files\nWriting Java host project\n\nProject files\n [+] Bundle \"MainBundle\"\n [+] Source \"BjsHelloJsWorld.java\" - in bundles (MainBundle)\n [+] Source \"HelloJsWorld.java\" - in bundles (MainBundle)\n [+] Source \"HelloNativeWorldBjsExport.java\" - in bundles (MainBundle)\n [+] Source \"HelloWorld.java\" - in bundles (MainBundle)\n ----------\n [-] deleted : 0\n [U] updated : 0\n [+] added : 5\n\nProcessing time: 0.84s\n```\n\n## Supported languages\n\nHere is a list of the native languages currently supported by bionic.js:\n- **Java and Kotlin** (ART on Android, JVM on Windows, macOS and Linux): \u003chttps://github.com/Forge-Srl/bionic-js-runtime-java\u003e\n- **Swift** (iOS and macOS): \u003chttps://github.com/Forge-Srl/bionic-js-runtime-swift\u003e\n- Coming soon: other JVM-based languages (Groovy, Scala, ...)\n- Coming soon: Objective-C, thanks to the Swift-Objective-C interoperability.\n\nbionic.js is open to the integration of new native languages and runtimes.\n\n\n## License\n\nSee the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforge-srl%2Fbionic-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforge-srl%2Fbionic-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforge-srl%2Fbionic-js/lists"}