nodejs卸载全局模块包
Let’s discuss the usage of Nodejs packages and modules and how it is been used in Nodejs projects.
让我们讨论一下Nodejs包和模块的用法以及如何在Nodejs项目中使用它。
Nodejs blessed with its extensive package management system called Node Package Manager (NPM). Each time a Command Line Interface (CLI) for npm comes as an add-on with Nodejs installation which allows developers to connect with packages locally on their machine.
Nodejs拥有广泛的软件包管理系统,称为Node Package Manager(NPM) 。 每当npm的命令行界面(CLI)作为Nodejs安装的附件出现时,开发人员都可以在其计算机上本地连接软件包。
Basically Nodejs comes with some plain JavaScript files that contain a bundle of codes for a specific purpose called “Modules”. The module pattern helps your code to navigate and works in an easier manner. To use such properties of a module, you have to require it from JavaScript file the same as importing a package in a Java class.
基本上,Nodejs附带了一些普通JavaScript文件,这些文件包含用于特定目的的称为“ Modules ”的一捆代码。 模块模式可帮助您的代码导航并以更轻松的方式工作。 要使用模块的此类属性,您必须像从Java类中导入包一样,从JavaScript文件中要求它。
Nodejs —软件包和模块 (Nodejs — Packages And Modules)
There are three kinds of modules available in Nodejs: user-defined modules, core modules, and external node_modules.
Nodejs中提供了三种模块:用户定义的模块,核心模块和外部node_modules。
In the require function, if the module name passed prefixed with ‘./’ or ‘../’ or ‘/’, then it is assumed to be a file-based module from the package and then the file is loaded.
在require函数中,如果传递的模块名称以'./'