Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

3 anni fa
12345678910111213141516171819202122232425262728293031323334
  1. # remove(path, [callback])
  2. Removes a file or directory. The directory can have contents. Like `rm -rf`.
  3. - `path` `<String>`
  4. - `callback` `<Function>`
  5. ## Example:
  6. ```js
  7. const fs = require('fs-extra')
  8. // remove file
  9. fs.remove('/tmp/myfile', err => {
  10. if (err) return console.error(err)
  11. console.log('success!')
  12. })
  13. fs.remove('/home/jprichardson', err => {
  14. if (err) return console.error(err)
  15. console.log('success!') // I just deleted my entire HOME directory.
  16. })
  17. // Promise Usage
  18. fs.remove('/tmp/myfile')
  19. .then(() => {
  20. console.log('success!')
  21. })
  22. .catch(err => {
  23. console.error(err)
  24. })
  25. ```