Advertisement

Node 03--在Node中使用模板引擎和渲染

阅读量:

使用readdir获取指定路径下的所有文件名

image.png
复制代码
    const fs = require('fs');
    
    fs.readdir('G:/pink_code/Node_Study/02',(err,list) => {
    if (!err) {
        console.log(list);
    }
    })
    
    
      
      
      
      
      
      
      
    
复制代码
    [ '01_http-helloWorld.js', '02_使用readdir获取指定路径下的所有文件名.js', 'www' ]
    
    
      
    

在浏览器中使用模板引擎

1. 安装art-template

复制代码
    npm install art-template
    
    
      
    

2. 通过script标签引入art-template

`

全部评论 (0)

还没有任何评论哟~