خرید بک لینک

Vote count: 0

I'm new to Electron, I use react to build my application, and I use browserify to compile jsx to js and es6 to es5, but when I use import to add the fs module( import fs from "fs" ), it retu a empty object. I guess I it may be the compiled file uses browserify's "require" to load module fs rather than node's "require". And when load the fs module, browserify retu a empty object directly. how can i solve this problem:joy:

import fs from 'fs';

class MyFS {

    static mkdir(path, mode){
        mode = mode || 0o777;

        retu new Promise(function(resolve, reject){
           fs.mkdir(path, mode, function(err){
               if(err){
                   reject(err);
                   retu;
               }

               resolve();
           });
        });
    }
 }

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 30 فروردين 1395 ساعت: 23:17

صفحه بندی