the modules installed locally with you install node js
1. path module
load:
var path = require(“path”)
using:
path.baname(__filename) # pluck out the file name from the path
path.join(*args) join a ries of path name with “/”
2. utilie module
var util = require(“util)
util.log() have a same result as console.log(), but it has log the time of the code loading time staple
//++++++++++++++
util.inherits(object1, ob2)
help ob1 to inherits all of function in ob2
3. v8
get current memory
var v8 = require(“v8”)
util.log(v8.getheapstatistics())
4. reading module
ask question to ur in termial and saving tho answers
var写景诗句 readline = require('readline')v面子问题ar rl = readline.createinterf马奔腾ace(process.stdin, proce枣庄大学ss.stout)# readline helps us to control thoes objectrl.question(string, function(answer))# ask question# handle the answer
rl.tprompt宁波九龙湖(”);
in the question() function to repeat the question prompt
5. eventemitter
require(‘events’);
var emitter = new events.eventemitter();
emitter.on(‘customevent’, function(string));
emitter.emit(‘customevent’, string1)
emit will push the cond argument into customevent and run it! \
本文发布于:2023-04-03 12:49:31,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/5f30047cb25c07de796a58e39b0124d3.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:Node.jsCoreModules核心模组ThemodulesdoneedtouseNPMinstall.doc
本文 PDF 下载地址:Node.jsCoreModules核心模组ThemodulesdoneedtouseNPMinstall.pdf
留言与评论(共有 0 条评论) |