在新的程序包标记规则之后,如何检查npm程序包名称的可用性?

koz*_*.am 7 node.js npm

情况:现在npm具有New Package Moniker规则,因此我们不能发布名称与现有软件包“太相似”的软件包。例如,我们不能发布名称为“ re.quest”的软件包,因为软件包“ request”已经存在。npm publish .将因错误而失败。

不幸的是,在尝试发布包名称之前,我们也无法检查包名称的可用性。

npm search re.quest 不会告诉我们有关“请求”包或任何其他将名称“ re.quest”视为不可用的原因的信息。

工具npm-name-cli会说'?re.quest可用”。

但事实并非如此。

问:有没有什么办法来检查实际 NPM包名的可用性,但不尝试发布呢?任何npm命令,CLI工具,npm站点API或其他任何东西?

ash*_*deh 1

使用npm search

\n

例如:

\n
PS C:\\Users\\ashkan nasirzadeh> npm search bable\nNAME                      | DESCRIPTION          | AUTHOR          | DATE       | VERSION  | KEYWORDS\nbable                     |                      | =sebmck         | 2015-02-16 | 1.0.1    |\nbable-import-style-suffix | Modify the suffix\xe2\x80\xa6   | =mi_huan        | 2020-08-21 | 1.0.0    | change import path suffix\n@kuddai/logonce           | Sometimes you wish\xe2\x80\xa6  | =kuddai         | 2020-06-27 | 1.0.0    | logging bable-plugin\njsmp-infra-nik-package    | my HW6 for Module2   | =nik_shaposhni\xe2\x80\xa6 | 2020-04-01 | 1.0.4    | node scripts bable\nbable-plugin-runmap       | show your code\xe2\x80\xa6      | =horve          | 2020-08-04 | 0.0.1    |\nmiaow-babel-parse         | Miaow\xe7\x9a\x84Babel\xe7\xbc\x96\xe8\xaf\x91\xe5\xb7\xa5\xe2\x80\xa6  | =anhulife       | 2017-04-01 | 2.1.0    | miaow bable es2015 es2016 jsx\n@58fe/bable-plugin-p5-imp | \xe9\x92\x88\xe5\xaf\xb9p5\xe7\xbb\x84\xe4\xbb\xb6\xe5\xba\x93\xe7\x9a\x84\xe6\x8c\x89\xe9\x9c\x80\xe2\x80\xa6  | =liuhanbing\xe2\x80\xa6    | 2019-08-01 | 1.1.0    | 58 p5 vue \xe6\x8c\x89\xe9\x9c\x80\xe5\x8a\xa0\xe8\xbd\xbd vue-components ui\nort                       |                      |                 |            |          |\n@oneisland/babler         | The perfectly\xe2\x80\xa6       | =larkin-nz      | 2019-11-08 | 0.0.9    | babler babel module-resolver oneisland\nvinus4                    | Vinus is an\xe2\x80\xa6         | =usamaxyz       | 2020-05-28 | 1.0.3    | bable typescript gulp browserify watchify less sass rtl minify concat es6\nbs-node-hello-world       | A Hello World\xe2\x80\xa6       | =albsugy        | 2017-07-02 | 0.0.1    |\nvinus                     | Vinus is an\xe2\x80\xa6         | =usamaxyz       | 2018-11-06 | 1.3.8    | bable typescript gulp browserify watchify less sass rtl minify concat es6\nrupert-plugin-babel       | Rupert\xe2\x80\xa6              | =davidsouther   | 2015-06-05 | 0.0.1    | rupert config esnext babel\n@jarzzzi/nidavel          | ## \xe7\x89\xb9\xe6\x80\xa7\xef\xbc\x9a - \xe6\x94\xaf\xe6\x8c\x81\xe2\x80\xa6    | =jarzzzi        | 2020-04-07 | 1.0.6    |\n@owo/owo                  | 1.\xe2\x80\xa6                  | =puge           | 2020-08-02 | 1.2.62   |\nbable-loader-ymh          |                      | =jerryfishymh   | 2019-10-25 | 3.0.0    |\nbable-plugin-transform-co | Babel preset to\xe2\x80\xa6     | =gyweqq         | 2018-12-25 | 1.0.0    |\npy                        |                      |                 |            |          |\nnode-bb                   | Simple node bable\xe2\x80\xa6   | =crashbell      | 2017-01-21 | 2.0.11   | node babel boilerplate\n@nolwenture/enumify       | This simply removes\xe2\x80\xa6 | =zanitius\xe2\x80\xa6      | 2018-06-17 | 1.0.3    |\nbable_es6                 |                      | =lapido         | 2017-08-10 | 1.0.15   |\nbabel-plugin-project-rela | A Bable plugin for\xe2\x80\xa6  | =gavriguy       | 2015-11-07 | 2.0.3    | babel babel-plugin\ntive-require\n
Run Code Online (Sandbox Code Playgroud)\n

如果你的包名还没有被使用过,你会遇到类似的情况:

\n
PS C:\\Users\\ashkan nasirzadeh> npm search phpAPI                                                                                                                     \nNo matches found for "phpAPI"\n
Run Code Online (Sandbox Code Playgroud)\n

有关此命令的更多信息可在此处找到

\n

  • 它不适用于“太相似”的名字。仅适用于精确匹配。 (2认同)