{"id":32538876,"url":"https://github.com/level/electron-demo","last_synced_at":"2026-03-07T19:33:07.820Z","repository":{"id":1359317,"uuid":"39085867","full_name":"Level/electron-demo","owner":"Level","description":"Demo app loading LevelDB into an Electron context.","archived":false,"fork":false,"pushed_at":"2023-05-01T06:57:27.000Z","size":60,"stargazers_count":81,"open_issues_count":2,"forks_count":11,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-10-18T23:44:16.694Z","etag":null,"topics":["demo","electron","electron-demo","level","leveldb","levelup","nodejs"],"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/Level.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,"governance":null}},"created_at":"2015-07-14T16:12:27.000Z","updated_at":"2025-08-15T08:58:11.000Z","dependencies_parsed_at":"2023-02-17T02:31:12.005Z","dependency_job_id":"e21872f2-4e17-483c-b73c-f429cab5cfa4","html_url":"https://github.com/Level/electron-demo","commit_stats":{"total_commits":81,"total_committers":11,"mean_commits":7.363636363636363,"dds":0.691358024691358,"last_synced_commit":"c10eaa7cf524ad666ba8a9353fefc59ee8b4c6e2"},"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/Level/electron-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Level%2Felectron-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Level%2Felectron-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Level%2Felectron-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Level%2Felectron-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Level","download_url":"https://codeload.github.com/Level/electron-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Level%2Felectron-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281457724,"owners_count":26504808,"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","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["demo","electron","electron-demo","level","leveldb","levelup","nodejs"],"created_at":"2025-10-28T14:56:36.148Z","updated_at":"2025-10-28T14:56:38.569Z","avatar_url":"https://github.com/Level.png","language":"JavaScript","funding_links":["https://opencollective.com/level"],"categories":[],"sub_categories":[],"readme":"# electron-demo\n\n**Demo app loading LevelDB into an Electron context.**\n\n[![level badge][level-badge]](https://github.com/Level/awesome)\n[![Test](https://img.shields.io/github/workflow/status/Level/electron-demo/Test?label=test)](https://github.com/Level/electron-demo/actions/workflows/test.yml)\n[![Standard](https://img.shields.io/badge/standard-informational?logo=javascript\u0026logoColor=fff)](https://standardjs.com)\n[![Donate](https://img.shields.io/badge/donate-orange?logo=open-collective\u0026logoColor=fff)](https://opencollective.com/level)\n\n## Get started\n\n```bash\ngit clone https://github.com/Level/electron-demo.git\ncd electron-demo\nnpm install\nnpm start\n```\n\nYou're now ready to use LevelDB. Try running `await db.put('key', 2)` in the devtools console of the Electron window, followed by `await db.get('key')`!\n\n## Architecture\n\nThe main process ([`main.js`](./main.js)) opens a LevelDB database using [`level`](https://github.com/Level/level) and exposes it to renderer processes ([`renderer.js`](./renderer.js)) using [`many-level`](https://github.com/Level/many-level). The processes communicate using [Electron IPC](https://www.electronjs.org/docs/latest/api/ipc-main). This approach is a secure default that allows renderer processes to be [sandboxed](https://www.electronjs.org/docs/latest/tutorial/sandbox). As a consequence, `require()` is not available, so we use `browserify` to bundle the JavaScript into a single file.\n\nAlternatively you can enable the potentially insecure [`nodeIntegration` option](https://www.electronjs.org/docs/latest/api/browser-window#new-browserwindowoptions) and do the following in a renderer process:\n\n```js\nconst { Level } = require('level')\nconst db = new Level('./db')\n```\n\nBut then only one process can open the database at the same time. Another alternative is to use [`browser-level`](https://github.com/Level/browser-level) in renderer processes, if you want each process to have its own database backed by IndexedDB.\n\nAs this is a demo, the implementation here (specifically the IPC) is not optimized and does not handle errors. The demo also does not include scripts to package up the Electron app for production (e.g. using `electron-builder`) which will require a few additional steps (e.g. `asarUnpack` in the case of `electron-builder`) due to the use of Node.js native addons.\n\n## Contributing\n\n[`Level/electron-demo`](https://github.com/Level/electron-demo) is an **OPEN Open Source Project**. This means that:\n\n\u003e Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.\n\nSee the [Contribution Guide](https://github.com/Level/community/blob/master/CONTRIBUTING.md) for more details.\n\n## Donate\n\nSupport us with a monthly donation on [Open Collective](https://opencollective.com/level) and help us continue our work.\n\n## License\n\n[MIT](LICENSE)\n\n[level-badge]: https://leveljs.org/img/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevel%2Felectron-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flevel%2Felectron-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevel%2Felectron-demo/lists"}