5
为什么前端界这么喜欢用 @ 号做为包名前缀?有什么好处或者目的吗?
source link: https://www.v2ex.com/t/803685
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
11 条回复 • 2021-09-23 18:39:47 +08:00
AoEiuV020 14 小时 39 分钟前 1
带 @多一级不会和别人重复,比如我有个包叫 hello, 但全局的 hello 已经有人占了,我就可以发在自己名下叫做 @AoEiuV020/hello
randyo 14 小时 38 分钟前
最近配置 .npmrc,设置了 registry 为淘宝源,又设置另一个私有包到私有源,发现不带 @ 它就走淘宝源,给私有包加了 @ 再配置,就可以了。这个私有包走私有源,其他包走淘宝源。
cydysm 14 小时 31 分钟前
https://docs.npmjs.com/cli/v7/using-npm/scope
这个叫 scope
Scopes are a way of grouping related packages together, and also affect a few things about the way npm treats the package.
Each npm user/organization has their own scope, and only you can add packages in your scope. This means you don't have to worry about someone taking your package name ahead of you. Thus it is also a good way to signal official packages for organizations.
这个叫 scope
Scopes are a way of grouping related packages together, and also affect a few things about the way npm treats the package.
Each npm user/organization has their own scope, and only you can add packages in your scope. This means you don't have to worry about someone taking your package name ahead of you. Thus it is also a good way to signal official packages for organizations.
mightofcode 12 小时 42 分钟前
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK