{"id":13683046,"url":"https://github.com/skittleson/ESP-TypeScript","last_synced_at":"2025-04-30T10:30:41.332Z","repository":{"id":41346941,"uuid":"465207535","full_name":"skittleson/ESP-TypeScript","owner":"skittleson","description":"Transpile TypeScript to Espruino flavor of JavaScript for ESP8266/ESP32 microcontrollers template project. Writing safe, maintainable, and testable code is the projects goal.","archived":false,"fork":false,"pushed_at":"2022-08-18T19:42:06.000Z","size":2016,"stargazers_count":162,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-08-02T13:34:50.599Z","etag":null,"topics":["esp32","esp8266","javascript","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/skittleson.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"skittleson"}},"created_at":"2022-03-02T07:50:56.000Z","updated_at":"2024-07-30T02:59:54.000Z","dependencies_parsed_at":"2022-09-15T23:00:51.550Z","dependency_job_id":null,"html_url":"https://github.com/skittleson/ESP-TypeScript","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/skittleson%2FESP-TypeScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skittleson%2FESP-TypeScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skittleson%2FESP-TypeScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skittleson%2FESP-TypeScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skittleson","download_url":"https://codeload.github.com/skittleson/ESP-TypeScript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224206399,"owners_count":17273451,"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":["esp32","esp8266","javascript","typescript"],"created_at":"2024-08-02T13:01:58.551Z","updated_at":"2024-11-12T02:32:56.108Z","avatar_url":"https://github.com/skittleson.png","language":"TypeScript","readme":"# ESP-TypeScript\n\n\u003cp\u003e\n  \u003cimg alt=\"Version\" src=\"https://img.shields.io/badge/version-1.0.4-blue.svg?cacheSeconds=2592000\" /\u003e\n  \u003ca href=\"#\" target=\"_blank\"\u003e\n    \u003cimg alt=\"License: ISC\" src=\"https://img.shields.io/badge/License-ISC-yellow.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://twitter.com/skittleson\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Twitter: skittleson\" src=\"https://img.shields.io/twitter/follow/skittleson.svg?style=social\" /\u003e\n  \u003c/a\u003e\n  \u003cimg alt=\"nycrc config on GitHub\" src=\"https://img.shields.io/nycrc/skittleson/ESP-TypeScript\"\u003e\n\u003c/p\u003e\n\n\u003e Transpile TypeScript to [Espruino](https://github.com/espruino/Espruino) flavor of JavaScript for ESP8266/ESP32 microcontrollers template project. Writing safe, maintainable, and testable code is the projects goal.\n\n## Install\n\n```sh\nnpm install\n```\n\n## Usage\n\nAdjust port used in `package.json` then:\n\n```sh\nnpm run-script transpile\n```\n\nPermanently save transpile code on device.\n\n```sh\nnpm run-script commit\n```\n\nMonitor serial responses\n\n```sh\nnpm run-script monitor\n```\n\n## Run tests\n\n```sh\nnpm test\n```\n\nCode coverage in `coverage/index.html`\n\n## Example\n\nThe simplest example in `blinky.ts`. Blink a LED.\n\n```typescript\nconst BUILTIN_LED = 2;\nexport function blinkly(intervalMs: number = 2000, pin: number = BUILTIN_LED) {\n  let toggleStatus = false;\n  setInterval(function () {\n    toggleStatus = !toggleStatus;\n    digitalWrite(pin, toggleStatus);\n  }, intervalMs);\n}\n```\n\nMore advance example using a class, properties, testing using mocks and type checking: `AdvanceBlinky` class in [advanceBlinky.ts](src/advanceBlinky.ts) with test at [test/blinky.spec.ts](test/blinky.spec.ts).\n\nIn depth documentation about [Espruino JavaScript API and flashing](https://www.espruino.com/Reference#software)\n\n## Road map\n\n- [x] Transpile TypeScript to Espruino flavor of JavaScript\n- [x] Example usage of typed code\n- [x] Short commands to build, upload, and monitor\n- [x] Unit testing\n- [x] Firmware guidance docs\n- [ ] Integration testing\n\n## Devices\n\n[Firmware selections](http://www.espruino.com/Download)\n\n[ESP8266](https://amzn.to/3vA67By)\n[![Wemos D1 mini ESP8266](original.jpg)](https://amzn.to/3vA67By)\n\n[ESP32](https://amzn.to/3Ml7Znx)\n[![Wemos ESP32](esp32.jpg)](https://amzn.to/3Ml7Znx)\n\nThese devices are also know to work: [https://templates.blakadder.com/](https://templates.blakadder.com/)\n\n## Author\n\n👤 **Spencer Kittleson**\n\n- Website: https://docodethatmatters.com\n- Twitter: [@skittleson](https://twitter.com/skittleson)\n- Github: [@skittleson](https://github.com/skittleson)\n- LinkedIn: [@skittleson](https://linkedin.com/in/skittleson)\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n","funding_links":["https://github.com/sponsors/skittleson"],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskittleson%2FESP-TypeScript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskittleson%2FESP-TypeScript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskittleson%2FESP-TypeScript/lists"}