const fs = require('fs');
const path = require('path');
const ncp = require('ncp').ncp;
ncp.limit = 16;

module.exports = {
    getCurrentDirectoryBase: () => {
        return path.basename(process.cwd());
    },

    directoryExists: (filePath) => {
        return fs.existsSync(filePath);
    },

    createDirectory: (dir)=>{
        return fs.mkdirSync(dir)
    },

    getFileByPath: (filePath, encoding) => {
        return fs.readFileSync(path.resolve(__dirname, '../' + filePath), encoding);
    },

    writeToFile: (filePath, data) => {
        return fs.writeFileSync(filePath, data);
    },
    
    copyFolder: (source, destination) =>{
        return ncp(path.resolve(__dirname, '../' + source), destination, { clobber: false })
    }
};