Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

精读《2021 前端新秀回顾》 #390

Closed
ascoders opened this issue Jan 14, 2022 · 5 comments
Closed

精读《2021 前端新秀回顾》 #390

ascoders opened this issue Jan 14, 2022 · 5 comments

Comments

@ascoders
Copy link
Owner

ascoders commented Jan 14, 2022

已经 2022 年了,2021 JavaScript Rising Stars 列出了 2021 年内前端各领域 Star 增势排行榜,这些势头在 2022 年大概率会保持下来,所以抓住这些趋势,如果还不熟悉就趁机了解一下。


精读《2021 前端新秀回顾》

@ascoders ascoders changed the title 精读《2021 新起之秀回顾》 精读《2021 前端新秀回顾》 Jan 15, 2022
@wednesday
Copy link

第二名 nest 和 next.js 很像,据我当时的了解,是因为 next.js 起步较慢,源码还不支持 ts,所以就有了这个更时髦的新框架。但实际上 next.js 早就全部改为 ts 了,而且正如整体榜单所说,现在已经开始引领潮流了,所以不怪 nest 定位重合,只能怪 next.js 后续发力太猛了。nest 的唯一特点就是没有绑定 UI 库。

nest 和 next完全不是一个定位的东西

@ascoders
Copy link
Owner Author

嗯,描述已修复。

@waitingsong
Copy link

waitingsong commented May 16, 2022

zx 这个东东很不错。尤其是是用 typescript + zx 写运维脚本,还可以用类型来约束以及重构,比 py 爽太多~~

@waitingsong
Copy link

waitingsong commented May 16, 2022

补充下, zx 其实有两种执行方式:

  1. 官网介绍的的, 用 zx 当执行器去执行, 比如 zx ./foo.mjs.
  2. ts-node-esm 当执行器,比如 ts-node-esm ./foo.ts ,这样就可以利用 ts 的类型约束了。非常舒服

example file bar.ts

#!/usr/bin/env ts-node-esm

import assert from 'node:assert/strict'
import { $, fs } from 'zx'
import minimist from 'minimist'

const argv = minimist(process.argv.slice(2))
console.info(argv) 

const dir: string = argv.dir ?? '.'
assert(dir, 'dir is required')

awairt $`ls -al ${dir}`

有第一行声明的 hashbang, 还可以执行直接文件

./bar.ts --dir=/tmp 

@a243065157
Copy link

a243065157 commented May 16, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants