Skip to content

Commit a757019

Browse files
committed
fs-extra
1 parent 963dca8 commit a757019

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2543,7 +2543,7 @@ app.listen(3000, function(){
25432543
<b><a href="#">↥ back to top</a></b>
25442544
</div>
25452545

2546-
## Q. ***Explain the terms body-parser, cookie-parser, morgan, nodemon, pm2, serve-favicon, cors, dotenv, checksum, fs-extra, moment in Express JS?***
2546+
## Q. ***Explain the terms body-parser, cookie-parser, morgan, nodemon, pm2, serve-favicon, cors, dotenv, fs-extra, moment in Express JS?***
25472547

25482548
**a) body-parser**
25492549

@@ -2784,6 +2784,29 @@ db.connect({
27842784
})
27852785
```
27862786

2787+
**i) fs-extra**
2788+
2789+
`fs-extra` contains methods that aren\'t included in the vanilla Node.js fs package. Such as recursive `mkdir`, `copy`, and `remove`. It also uses graceful-fs to prevent `EMFILE` errors.
2790+
2791+
**Installation**
2792+
2793+
```bash
2794+
npm install fs-extra
2795+
```
2796+
2797+
**Usage**
2798+
2799+
```js
2800+
const fs = require('fs-extra')
2801+
2802+
2803+
// Async with callbacks:
2804+
fs.copy('/tmp/myfile', '/tmp/mynewfile', err => {
2805+
if (err) return console.error(err)
2806+
console.log('success!')
2807+
})
2808+
```
2809+
27872810
<div align="right">
27882811
<b><a href="#">↥ back to top</a></b>
27892812
</div>
@@ -2916,7 +2939,8 @@ module.exports = router
29162939
#### Q. ***How to use Q promise in Node.js?***
29172940
#### Q. ***How to use locale (i18n) in Node.js?***
29182941
#### Q. ***How to implement Memcached in Node.js?***
2919-
#### Q. ***Explain Error Handling in Node.js?***
2942+
#### Q. ***Explain error handling in Node.js?***
2943+
#### Q. ***How to generate and verify checksum of the given string in Node.js***
29202944

29212945
<div align="right">
29222946
<b><a href="#">↥ back to top</a></b>

0 commit comments

Comments
 (0)