当前位置:网站首页>Deno介绍
Deno介绍
2022-07-06 03:17:00 【phial03】
- deno官网:https://deno.land/
- deno中文翻译网:https://deno-cn.vercel.app/
什么是Deno?
Node.Js 作者 Ryan Dahl 在2018年8月23日发布了第一个版本v0.1.0的deno,为什么Ryan Dahl要革自己的命创造一个新的运行时呢?
- 模块导入规则太多且不兼容:ES模块、CommonJs…
- node_modules黑洞
- 有callback ES5、Promise ES6和async/await(基于Promise)ES7的两种写法
- 工具太多(webpack、vite、babel、tsc…)
- 阮一峰大佬对deno的讲解:deno讲解
学习成本
学习deno更关心的肯定是语言,deno的定位任然是runtime运行时,但是特别的是它是Typescript、JavaScript的运行时,也就是能直接运行Typescript(内部任然会将ts编译成js)和Javascript
所以说使用node的同学可以ECMAscript语法上无缝迁移到node
学习点:
deno工具命令:因为没有了npm,包管理都是deno在帮助我们
deno一些特例语法:因为最上乘用promise构建,比较少。
for await(const conn of listener) {
// ...
}
- 工作: 因为deno才v1.18.2版,想尝试找不找得到deno相关开发
如果你为了找工作,还不如去学node,搞企业级微服务开发必须学Typescript,目前很有思想的框架都在用,如支持Ioc DI、Aop…的框架midwayjs、nestjs、darukjs、malagujs,如果你很喜欢serverless推荐使用malagujs
搞企业级的框架在deno中不存在吗?存在,请看生态
生态
目前优质的deno库:https://github.com/hylerrix/awesome-deno-cn
支持deno的发现源(不确定一定是deno的,它也支持node):https://www.skypack.dev/
官方发现源(一定支持deno):https://deno.land/x
思考点:node能干的web应用、构建vue、react项目工具
web应用的库/框架:
仿koa的:https://github.com/ako-deno/ako
仿express的:https://github.com/cmorten/opine
受nest启发的typescript库(开发中…):https://github.com/SampaioLeal/destjs构建前端项目的库/框架:
受next.js(react)启发的SSR框架:https://alephjs.org/docs
在deno下运行的构建Vue2/3的工具:https://github.com/mggower/vno
为什么nest目前不准备迁移到deno?
官方打算看看deno的发展再做打算 issue:https://github.com/nestjs/nest/issues/4495
原话:“Deno 还不够成熟,甚至无法在当前尝试将 NestJS 移植到它。我建议我们首先看看“更小”的 Node.js 项目它是如何随着发展的——无论它们是被移植还是重写。根据社区设定的趋势和“标准”,我们将考虑与 NestJS 一起移动。”
deno有了Compat Mode兼容node.js, 但是不支持typescript,issue:https://github.com/nestjs/nest/issues/8867
因为兼容不支持typescript,那等同于把项目写好了用deno跑,意义不大
- 想法与感受
现在最需要的是沉下心去用typescript和node去写一些工具,比如一些Vue、React、Nestjs的模板用脚手架去封装。
至于deno如果它随着它的生态越来越好,等到时候再去了解他使用它也不迟,deno说实话还是有很多路需要走的,因为刚出所以很多serverless是不支持的,除非自定义deno环境,目前工作基本也没有,而且企业级框架deno也没有很完善。
总的来说目前deno没有压倒性的理由让我去用,反而给我带来的是一些缺点,如:生态,资源没npm中心源清晰等,deno正在一个发展期的小恐龙,也希望有朝一日,也能再企业内体会到它的风采。
deno分析:
我们并不需要deno:https://segmentfault.com/a/1190000040122104deno教程:
Deno入门手册:
https://chinese.freecodecamp.org/news/the-deno-handbook-with-examples/了不起的 Deno 入门与实战:
https://juejin.cn/post/6844904162321252360异步函数在deno中的超时:
https://medium.com/deno-the-complete-reference/timeout-for-async-functions-in-deno-52cee16e6e92
边栏推荐
- Who is the winner of PTA
- Function knowledge points
- Microsoft Research, UIUC & Google research | antagonistic training actor critic based on offline training reinforcement learning
- resulttype和resultmap的区别和应用场景
- 1. Dynamic parameters of function: *args, **kwargs
- Differences and application scenarios between resulttype and resultmap
- How to choose PLC and MCU?
- Buuctf question brushing notes - [geek challenge 2019] easysql 1
- [pointer training - eight questions]
- 指针笔试题~走近大厂
猜你喜欢
Jenkins basic knowledge ----- detailed explanation of 03pipeline code
Computer graduation project asp Net fitness management system VS development SQLSERVER database web structure c programming computer web page source code project
MySQL advanced notes
Sign SSL certificate as Ca
MySQL Server层四个日志
Web security SQL injection vulnerability (1)
Mysqldump data backup
Game theory matlab
Explore pointers and pointer types in depth
SAP ALV颜色代码对应颜色(整理)
随机推荐
codeforces每日5題(均1700)-第六天
深度解析指针与数组笔试题
Redis cache breakdown, cache penetration, cache avalanche
Problems encountered in 2022 work IV
【指针训练——八道题】
C # create self host webservice
Summary of Bible story reading
11. Container with the most water
Quartz misfire missed and compensated execution
OCR文字识别方法综述
Audio-AudioRecord Binder通信机制
MySQL advanced notes
【paddle】加载模型权重后预测报错AttributeError: ‘Model‘ object has no attribute ‘_place‘
Arabellacpc 2019 (supplementary question)
jsscript
OCR文字識別方法綜述
Overview of OCR character recognition methods
How to do function test well
MySQL Server层四个日志
Misc (eternal night), the preliminary competition of the innovation practice competition of the National College Students' information security competition