0%

Deprecated js库

我们在install一些库的时候, 可能会看到一些提示, 表明这个js库已经废弃了, 让大家去用xx库的。

1
2
3
4
5
6
7
8
9
10
11
12
13
14

0524$ npm i jQuery
npm WARN deprecated jQuery@1.7.4: This is deprecated. Please use 'jquery' (all lowercase).
npm WARN saveError ENOENT: no such file or directory, open '/Volumes/Code/test/0524/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Volumes/Code/test/0524/package.json'
npm WARN 0524 No description
npm WARN 0524 No repository field.
npm WARN 0524 No README data
npm WARN 0524 No license field.

+ jQuery@1.7.4
added 1 package from 1 contributor in 0.298s


其实很简单, 发布前在package.json中添加一个字段 deprecated,就可以了

1
2
3
4
5
6
// package.json

{
...
"deprecated": "This is deprecated. Please use 'jquery' (all lowercase)."
}

欢迎关注个人公众号 微信 -> 搜索 -> fishmwei,沟通交流。