随笔分类 - js/ts
摘要:官网:https://help.aliyun.com/document_detail/32068.html?spm=a2c4g.11174283.6.1259.7bc17da2koCrAk 安装: npm install @types/ali-oss 使用 import * as OSS from
阅读全文
摘要:导出word的功能,目前看了两个模块:officegen 和 docxtemplater officegen是自己绘制word格式: https://github.com/Ziv-Barber/officegen docxtemplater以模板替换的模式 : https://docxtemplat
阅读全文
摘要:hello.ts代码 function sayHello(person: string): string { return 'Hello, ' + person; } let user = 'Tom'; console.log(sayHello(user)); 执行 1. 编译,生成一个编译好的文件
阅读全文
摘要:下面对于上面代码进行分解: 一. 在读取或者处理文件之前,必须先使用fs.open()函数打开文件,然后使用文件描述符调用所提供的回调函数,稍后就可以用这个回调函数对打开的文件进行读写. fs.open(path, flags, callback)函数的参数: 1. path: 文件路径 2. fl
阅读全文
摘要:这里使用的是exceljs模块, 好上手,易操作 1. 大致使用步骤 npm install exceljs // 引用var Excel = require('exceljs'); // 创建一个workbook对象: var workbook = new Excel.Workbook(); 2.
阅读全文