How to use the sync function from make-dir

Find comprehensive JavaScript make-dir.sync code examples handpicked from public code repositorys.

154
155
156
157
158
159
160
161
162
163
copyFile(source, dest, header) {
    if (path.isAbsolute(dest)) {
        throw new Error(`Cannot write to absolute path: ${dest}`);
    }
    dest = path.resolve(this.baseDir, dest);
    mkdirp.sync(path.dirname(dest));
    let contents;
    if (header) {
        contents = header + fs.readFileSync(source, 'utf8');
    } else {
fork icon0
star icon0
watch icon1