您好,欢迎光临本网站![请登录][注册会员]  

搜索资源列表

  1. NodeJS的模块写法入门(实例代码)

  2. 前面提到了NodeJS的命令行和Web版之“Hello,World”。命令行是直接执行hello.js文件,Web版的需要require http模块。http模块是NodeJS自身提供的
  3. 所属分类:其它

    • 发布日期:2020-10-28
    • 文件大小:26624
    • 提供者:weixin_38636461
  1. NodeJS的模块写法入门(实例代码)

  2. 我们知道每个模块对应一个js文件,这篇写一个最简单的模块hello.js, 然后在另一个js文件(main.js)中require自定义的模块。 hello.js 代码如下: function hello(name) { console.log(‘hello, ‘+ name); } exports.hello = hello; main.js 代码如下: var h = require(‘./hello’); h.hello(‘snandy’); 约定:hello.js和main.js
  3. 所属分类:其它

    • 发布日期:2021-01-19
    • 文件大小:23552
    • 提供者:weixin_38595528