file-manipulator
Version:
## Easy File operations library
16 lines (14 loc) • 874 B
text/typescript
import fileManipulator from './lib/index'
const moveJs = async () => {
const isExistBuild = await fileManipulator.utils.checkExist('./build')
console.log({isExistBuild})
if (isExistBuild) {
await fileManipulator.move.file({name: 'index', ext: 'js', from: './build', to: './', replaceExisting: true})
await fileManipulator.move.file({name: 'types', ext: 'js', from: './build', to: './', replaceExisting: true})
await fileManipulator.move.file({name: 'utils', ext: 'js', from: './build', to: './', replaceExisting: true})
await fileManipulator.move.file({name: 'example', ext: 'js', from: './build', to: './', replaceExisting: true})
await fileManipulator.move.folder({name: 'src', from: './build', to: './', replaceExisting: true})
await fileManipulator.delete.folder({name: 'build', path: './'})
}
}
moveJs()