Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asfak00/learning-backend
this repository is for my learning code storing. I am completing the leasoin and push in here for I can find my code in any days
https://github.com/asfak00/learning-backend
Last synced: 17 days ago
JSON representation
this repository is for my learning code storing. I am completing the leasoin and push in here for I can find my code in any days
- Host: GitHub
- URL: https://github.com/asfak00/learning-backend
- Owner: Asfak00
- Created: 2023-07-20T05:02:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-22T03:52:55.000Z (over 1 year ago)
- Last Synced: 2023-07-22T07:20:34.641Z (over 1 year ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Here is my all note whatever I am learning in this repo
## Day 1
### MODULE
-
Module is a set of function. ( Think about js libraries such us Math ) -
3 type of modules.-
Local Module. ( Own created modules ) -
Built-in Module. ( Node js own modules ) - http, url, path, fs ( no need to install ) -
External Module. ( Managed by NPM )
-
## Day 2
### FS Module - file system module
#### function/method of fs module
# async
-
writeFile("file name", "file content", callback function) - we can create a file using this method!`Note: if you have already created an account using this method and you try to
create another file using this method then this method over write you older file
when your new file name is same to you older file.` -
appendFile("file name", "file content", callback function) - we can append any content to our file using this method`Note: if you have a file already and you want to add some new content to your
file you can do this using this " appenFile " method. This method appeded
content in your selected file.` -
readFile("file name", "utf-8", "callback function - this function (err,data) received ) - we can read file content using this method`Note: Why we are use "utf-8"? it is an coding system. if you not use this you
will not read you currect data. And the callback function have error and data
perameter, we can access those perameter.` -
rename("current file name", "update file name", callback Function) - we can rename our exsiting file name using this method -
Unlink("file name", callback function) - we can delete our selected file using this method -
Exists("file name", callback function) - we can find is our file here or not using this method
# sync
> the difference between async and sync is just callback function. When we use fs module we can use async method and we also use sync method from fs module. When we use async method in the fs module we will define a callback function in our method, but when we will use sync method we cann't use callback function in our fs sync method.
-
writeFileSync() -
appendFileSync() -
readFileSync() -
renameSync() -
UnlinkSync() -
ExistsSync()