{"id":22283797,"url":"https://github.com/veaba/deno-typescript-service","last_synced_at":"2025-06-12T17:31:50.515Z","repository":{"id":104582125,"uuid":"175580514","full_name":"veaba/deno-typescript-service","owner":"veaba","description":"基于deno+typescript 构建的后端服务，对应阿里云 docker-typescript-service","archived":false,"fork":false,"pushed_at":"2019-09-02T07:51:51.000Z","size":233,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T19:53:28.052Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/veaba/deno-typescript-service","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/veaba.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":"2019-03-14T08:33:23.000Z","updated_at":"2019-09-02T07:51:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"09d4fd5e-255d-4340-86fc-7553cf259aec","html_url":"https://github.com/veaba/deno-typescript-service","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/veaba/deno-typescript-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veaba%2Fdeno-typescript-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veaba%2Fdeno-typescript-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veaba%2Fdeno-typescript-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veaba%2Fdeno-typescript-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/veaba","download_url":"https://codeload.github.com/veaba/deno-typescript-service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veaba%2Fdeno-typescript-service/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259511990,"owners_count":22869325,"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":[],"created_at":"2024-12-03T16:42:19.678Z","updated_at":"2025-06-12T17:31:50.487Z","avatar_url":"https://github.com/veaba.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## docker \n\u003e docker pull registry.cn-beijing.aliyuncs.com/veaba/deno-typescript-service:latest\n\n## deno run typescript code demo! \n\n使用deno 去运行同一段代码，分别为js、ts后缀，测试发现deno运行ts后缀的文件比deno运行js文件性能提升了——100%，结果感人！ry，请收下膝盖吧！\n\n\u003e 基于deno typescript runtime 开发typescript代码的demo、笔记。以下测试纯属test，不在是非常严格的环境下进行的。\n\n\n## 关于本镜像内容\n\n- bash √\n- curl √\n- node@10.15.3 √\n- npm@6.11.2 √\n- v8@7.6.53 √\n- deno@0.7.0 √\n- @vue/cli √\n- vue@3.11.0 √\n- typescript@ √\n- tsc@3.5.1 √\n- cnpm@6.1.0 √\n\n## 安装deno 省略，以下内容是以往测试代码\n    - windows 安装\n    - linux 安装\n## 测试版本\n    - deno:0.3.2\n    - v8:7.4.238\n    - typescript:3.2.1\n## linux run deno\n![linux jpg](/images/deno_run_linux.jpg)\n## windows run deno\n![windwos jpg](/images/deno_run_windows.jpg)\n\n## wow!! deno 和 node 去测试一段代码，结果感人！！\n- node 测试的代码，10次循环打印\n```js\nconsole.time('js')\nfor(let i=0;i\u003c10;i++){\n    console.log('_______'+i+'_______')\n}\nconsole.timeEnd('js')\n```\n- deno 测试的代码，10次循环打印\n```typescript\nconsole.time('ts')\nfor(let i=0;i\u003c10;i++){\n    console.log('_______'+i+'_______')\n}\nconsole.timeEnd('ts')\n```\n\n### 如果一万次打印?\n\n- node 测试10000次\n\n![node test 10000 times](/images/node_test_10000_times.png)\n\n- deno 测试10000次\n\n![deno test 10000 times](/images/deno_test_10000_times.png)\n\n### 分别测试 node 运行js、deno 运行ts，console 1w次,10个回合对比\n\n    - 打印次数1w次\n    - 代码两份，代码内容一样，分别为`run_test.js`、`run_test.ts`\n\n\n 单位:ms,round 10次！,\n\n|round|node `run_test.js`|deno `run_test.ts`|result|winner|\n|----|----|----|----|----|\n|1|9047.543|9145|-97.457|`node`|\n|2|8927.828|8885|+42.828|`deno`|\n|3|8184.502|8199|-14.498|`node`|\n|4|8714.305|8721|-6.695|`node`|\n|5|9162.195|9223|-60.805|`neno`|\n|6|8721.956|8684|+37.956|`deno`|\n|7|8750.158|8618|+132.158|`deno`|\n|8|8955.538|8867|+88.538|`deno`|\n|9|8794.462|8820|-25.538|`node`|\n|10|8484.291|8380|+104.291|`deno`|\n||||||\n\n- 结果：deno vs node === 5:5，擦,一样，震惊了。\n\n\n### 但是，如果不console呢？\n\n- node code\n```js\nconsole.time('js')\nfor(let i=0;i\u003c10000;i++){\n    // console.log('_______'+i+'_______')\n}\nconsole.timeEnd('js')\n```\n- deno code\n\n```typescript\nconsole.time('ts')\nfor(let i=0;i\u003c10000;i++){\n    // console.log('_______'+i+'_______')\n}\nconsole.timeEnd('ts')\n```\n\n结果：\n\n![no_console_print.png](/images/no_console_print.png)\n\n\n### deno vs node，无console 1w次for循环比较\n\n打印了数次，结果deno全是0，意味着什么吗？！！node 在打印空的for循环，压根就没运行！！！没错，这就是传说中的安全了吧？？\n\n![test_10000_times_node_vs_deno_console.png](/images/test_10000_times_node_vs_deno_console.png)\n\n### deno 完全可以替代node呀！！deno 分别测试 同一个代码的js文件和ts文件\n\n- js 文件，1w次打印\n\n代码：\n\n```js\nconsole.time('js')\nfor(let i=0;i\u003c10000;i++){\n    console.log('_______'+i+'_______')\n}\nconsole.timeEnd('js')\n```\n\n截图：\n\n![deno_run_test_js_10000_times.png](/images/deno_run_test_js_10000_times.png)\n\n\n- ts 文件，1w次打印\n\n代码：\n```typescript\nconsole.time('ts')\nfor(let i=0;i\u003c10000;i++){\n    console.log('_______'+i+'_______')\n}\nconsole.timeEnd('ts')\n```\n\n截图：\n\n![deno_run_test_ts_10000_times.png](/images/deno_run_test_ts_10000_times.png)\n\n\n- 结果：\n\n\u003e 非常感人！！使用deno 去运行同一个段代码，ts文件比js文件，性能 提升100% ！！\n\n    - js 1393ms\n    - ts 696ms  !!\n\n\u003e ry，请收下我的膝盖吧~~~\n\n\n### node、deno 分别测试run_test.js,1w次打印,对比10次\n\n- 结果如下：\n - node 和 deno 运行同一个js文件，几乎表现无异(为了确保其他因素干扰，分别开两个cmd窗口)\n \n\n 单位:ms,round 10次！\n\n|round|node|deno|result|winner|\n|----|----|----|----|----|\n|1|12481.508|12687|-205.492|`node`|\n|2|13735.104|13468|+267.104|`deno`|\n|3|7394.730|7329|+65.730|`deno`|\n|4|7441.146|7404|+37.146|`deno`|\n|5|7617.898|7986|-368.102|`node`|\n|6|7980.040|8237|-256.960|`node`|\n|7|7496.829|7746|-249.171|`node`|\n|8|7595.771|7923|-327.229|`node`|\n|9|8089.464|8506|-416.536|`node`|\n|10|7611.490|7856|-244.510|`node`|\n||||||\n\n结果：deno vs node === 3：7\n- 在1w次console下，node 反而比deno好！\n\n\u003e 吐槽：deno为啥每次都是整数？？\n\n![run_js_node_vs_deno.png](/images/run_js_node_vs_deno.png)\n\n## bug和不足\n1. 无法识别import from，必须是绝对路径\n2. 且后缀无法省略\n![module_err.png](/images/module_err.png)\n\n\n__________________________\n\n2019年3月14日16:31:28\n\nby @veaba\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveaba%2Fdeno-typescript-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fveaba%2Fdeno-typescript-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveaba%2Fdeno-typescript-service/lists"}