node.js 我需要从 npm 安装加密模块吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16144274/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 14:15:42  来源:igfitidea点击:

Do i need to install crypto module from npm?

node.jsnpmnode-crypto

提问by Yalamber

I am making use of crypto module in my app. It seems like there is crypto module distributed in nodejs http://nodejs.org/api/crypto.htmlso do i need to do npm install crypto? what is the difference from https://npmjs.org/package/cryptoand nodejs api crypto modules?

我正在我的应用程序中使用加密模块。似乎在 nodejs http://nodejs.org/api/crypto.html 中分发了加密模块, 所以我需要执行 npm install crypto 吗?与https://npmjs.org/package/crypto和 nodejs api 加密模块有什么区别?

回答by matthewtole

If you are using the methods from the Crypto module that comes with NodeJS, i.e. those described on http://nodejs.org/api/crypto.htmlthen no, you do not need to do npm install crypto.

如果您正在使用 NodeJS 附带的 Crypto 模块中的方法,即http://nodejs.org/api/crypto.html 上描述的方法,那么不,您不需要执行npm install crypto