以加载第三方时间处理模块( moment )为例 : 

一,加载

npm install moment 

二,使用介绍

1,点击进入npm官网 https://www.npmjs.com/

2,搜索 moment,点击进入moment详情页面,

13 —— node 获取文件属性 —— 加载第三方模块

 ------------------------------------------------------------------------------------------------------------------------------

13 —— node 获取文件属性 —— 加载第三方模块

3,点击 Documentation 进入moment 使用文档

 

 

13 —— node 获取文件属性 —— 加载第三方模块

 

三,实战,其中部分

 

const moment = require('moment');
 
data_arr[i].mtime = moment(files.mtime).format('YYYY/MM/DD hh:mm:ss');
 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2021-06-25
  • 2021-09-20
  • 2021-08-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2021-07-17
  • 2021-09-11
  • 2022-02-11
相关资源
相似解决方案