node-extra
v2.1.3
Published
Provides many node related methods. For example: cp, etc
Downloads
4
Maintainers
Readme
node-extra
Provides many node related methods. For example: cp, etc
usage method
npm install node-extra --save-dev
yarn add node-extra --save-dev
Provide use method
fs module
- [isFileExists]: a sync method, juage file exist
- [isDirExists]: a sync method, juage folder exist
- [wContent]: a sync method, writes the contents to the specified file
- [rmFile]: a promise method, remove assign list
- [cpFile]: a promise method, The folder will be specified Copy to another directory for example
for example
const {fs} = require('node-extra');
fs.cpFile('/src', '/dist')
process module
- [isFileExists]: Provides a method to execute the run command, example, npm install node-extra
const {process} = require('node-extra');
process.runCommand('npm', ['install']).then(() => {
// exec success result
}).catch(() => {
// exec fail result
})