尊龙凯时人生就是搏

jsÔõô½¨ÉèÎļþ¼Ð

ʹÓà js ½¨ÉèÎļþ¼ÐÐèÒªµÚÈý·½¿â»ò node.js µÄ fs Ä £¿é £¬ÏêϸҪÁìÈçÏ£ºµÚÈý·½¿â£ºjs-file-manager£ºÒ»¸öÇáÁ¿¼¶µÄ¿â £¬Ìṩ½¨ÉèÎļþ¼Ð¡¢¶ÁÈ¡¡¢Ð´ÈëÎļþµÈ¹¦Ð§¡£fs-extra£ºÀ©Õ¹ÁË node.js Ô­Éú fs Ä £¿é £¬Ìí¼ÓÁ˽¨ÉèÎļþ¼ÐµÈ¹¦Ð§¡£node.js fs Ä £¿é£ºfs.mkdir(path)£ºÓÃÓÚ½¨ÉèÎļþ¼Ð¡£ÈôÊÇÎļþ¼Ð²»±£´æ £¬Ôò»á½¨ÉèËü¡£ÈôÊÇÎļþ¼ÐÒѱ£´æ £¬Ôò²»»áÖ´ÐÐÈκβÙ×÷¡£fs.mkdirsync(path)£ºfs.mkdir µÄͬ²½°æ±¾¡£Ëü»áÅ׳öÒì³£ £¬ÈôÊÇÎļþ¼ÐÒÑ

ÔõÑùʹÓà JS ½¨ÉèÎļþ¼Ð

Ö±½Ó»Ø¸²£º

ʹÓà JS ½¨ÉèÎļþ¼Ð £¬ÐèÒª½èÖúµÚÈý·½¿â»ò Node.js µÄ fs Ä £¿é¡£

ÏêϸÕö¿ª£º

µÚÈý·½¿â£º

js-file-manager£ºÒ»¸öÇáÁ¿¼¶µÄ¿â £¬Ìṩ½¨ÉèÎļþ¼Ð¡¢¶ÁÈ¡¡¢Ð´ÈëÎļþµÈ¹¦Ð§¡£

fs-extra£ºÀ©Õ¹ÁË Node.js Ô­Éú fs Ä £¿é £¬Ìí¼ÓÁ˽¨ÉèÎļþ¼ÐµÈ¹¦Ð§¡£

Node.js fs Ä £¿é£º

fs.mkdir(path)£ºÓÃÓÚ½¨ÉèÎļþ¼Ð¡£ÈôÊÇÎļþ¼Ð²»±£´æ £¬Ôò»á½¨ÉèËü¡£ÈôÊÇÎļþ¼ÐÒѱ£´æ £¬Ôò²»»áÖ´ÐÐÈκβÙ×÷¡£

fs.mkdirSync(path)£ºfs.mkdir µÄͬ²½°æ±¾¡£Ëü»áÅ׳öÒì³£ £¬ÈôÊÇÎļþ¼ÐÒѱ£´æ¡£

ʾÀý£º

ʹÓà js-file-manager£º

const fileManager = require('js-file-manager');

fileManager.mkdir('my-folder');

µÇ¼ºó¸´ÖÆ

ʹÓà fs-extra£º

const fs = require('fs-extra');

fs.mkdir('my-folder');

µÇ¼ºó¸´ÖÆ

ʹÓà fs Ä £¿é£º

const fs = require('fs');

fs.mkdir('my-folder', (err) => {
  if (err) {
    // ÍÉ»¯´¦Àí
  }
});

µÇ¼ºó¸´ÖÆ

ͬ²½°æ±¾£º

fs.mkdirSync('my-folder');

µÇ¼ºó¸´ÖÆ

ÒÔÉϾÍÊÇjsÔõô½¨ÉèÎļþ¼ÐµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是搏ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是搏ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ