作为一个从java转过来的码农来说,我想知道node.js对于各种模块应该也有类似于java那种类的api吧!可是我却找不到,还有我想知道java的类和node.js的模块有什么区别?有什么相同点和不同点?
认证0级讲师
It just so happens that I also worked in Java before (although I haven’t used it deeply, but I can talk about it and understand it)
Java platform includes:
Java Programming Language
Java Class file format
Java Application Programming Interface (API)
Virtual Machine (HotSpot, etc.)
Corresponds to the node platform:
ECMAScript
(none)
node platform API
Javascript Engine (V8)
Comparison of other concepts:
Java package - node module
Java maven - node npm
Java class - ES6 Class (ES5 simulation class)
The two APIs are not at the same level and are not comparable.
JDK’s built-in API has thousands of classes
The built-in API of nodejs only has dozens of classes and functions.
nodejs only provides the most basic API, most functions require third-party libraries to implement
It just so happens that I also worked in Java before (although I haven’t used it deeply, but I can talk about it and understand it)
Java platform includes:
Java Programming Language
Java Class file format
Java Application Programming Interface (API)
Virtual Machine (HotSpot, etc.)
Corresponds to the node platform:
ECMAScript
(none)
node platform API
Javascript Engine (V8)
Comparison of other concepts:
Java package - node module
Java maven - node npm
Java class - ES6 Class (ES5 simulation class)
The two APIs are not at the same level and are not comparable.
JDK’s built-in API has thousands of classes
The built-in API of nodejs only has dozens of classes and functions.
nodejs only provides the most basic API, most functions require third-party libraries to implement