13 - node access to file attributes - load third-party modules

Time to load third-party processing module ( Moment ) as an example: 

A load

npm install moment 

Second, the use Description

1, click to enter the official website npm  https://www.npmjs.com/

2, searching moment, details page click into the moment,

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

3 Click Documentation using the document into the moment

 

 

 

Third, actual, some of which

 

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

 

Guess you like

Origin www.cnblogs.com/500m/p/10948579.html