javascript
马红权
从事分析仪器软件开发N年,掌握语言平台无数。
展开
-
通过promise 解决打开文件过多的错误。
写了个脚本把material-ui的图标js文件转换为svg文件,由于文件数量多,出现EMFILE: too many open files错误。改为等待writestream关闭。function changeOne(one){ return new Promise( function (resolve, reject) { var F1=require("@material-ui/icons/"+one).default; var str=R原创 2021-04-18 14:05:54 · 106 阅读 · 0 评论 -
javascript sleep by promise
function sleep(ms) { return new Promise(resolve=>setTimeout(resolve, ms))}async function main(){ console.log("wait") await sleep(5000); console.log("finish")}main()原创 2021-04-18 13:59:19 · 89 阅读 · 0 评论 -
遇到esbuild 的一个bug。
showdown2.subParser("githubCodeBlocks", function(text, options2, globals) { "use strict"; if (!options2.ghCodeBlocks) { return text; } text = globals.converter._dispatch("githubCodeBlocks.before", text, options2...原创 2021-03-27 08:25:05 · 575 阅读 · 0 评论