mirror of
https://github.com/m-lamonaca/dev-notes.git
synced 2025-07-04 19:22:12 +00:00
Fix typos
This commit is contained in:
parent
76550dfa3c
commit
5c0799df7f
118 changed files with 1150 additions and 1602 deletions
|
@ -14,12 +14,12 @@ class CustomEmitter extends EventEmitter {} ;
|
|||
const customEmitterObj = new CustomEmitter();
|
||||
|
||||
// add event listener
|
||||
cusomEmitterObj.on("event", (e) => {
|
||||
customEmitterObj.on("event", (e) => {
|
||||
// e contains event object
|
||||
})
|
||||
|
||||
// single-use event listener (execute and remove listener)
|
||||
cusomEmitterObj.once("event", (e) => {
|
||||
customEmitterObj.once("event", (e) => {
|
||||
// e contains event object
|
||||
})
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# fs (FIle System) Module
|
||||
|
||||
Async versions can acces file at the same time which can lead to conflicts in operations, erros can be handled in callback.
|
||||
Async versions can access file at the same time which can lead to conflicts in operations, errors can be handled in callback.
|
||||
Sync versions cannot interfere with each other, errors cause exceptions, handle in try-catch.
|
||||
|
||||
## Files
|
||||
|
@ -71,7 +71,7 @@ fs.rmdirSync(path, recursive=false;
|
|||
### Reading Directory Contents
|
||||
|
||||
```js
|
||||
// read directrory contents
|
||||
// read directory contents
|
||||
fs.readdir(path, (err, files) => {}); // files is string[]
|
||||
fs.readdir(path, { withFileTypes: true }, (err, files) => {}); // files is Dirent[]
|
||||
fs.readdirSync(path); // returns string[] of files/directories
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# HTTP(S) Module
|
||||
|
||||
## HTTTP(S) IncomingMessage (request)
|
||||
## HTTPS(S) IncomingMessage (request)
|
||||
|
||||
### Making a request
|
||||
|
||||
|
@ -17,7 +17,7 @@ https.request(
|
|||
).end();
|
||||
```
|
||||
|
||||
### Reqest Methods & Properties
|
||||
### Request Methods & Properties
|
||||
|
||||
```js
|
||||
IncomingMessage.headers
|
||||
|
@ -26,7 +26,7 @@ IncomingMessage.statusMessage
|
|||
IncomingMessage.url
|
||||
```
|
||||
|
||||
## HTTTP(S) ServerResponse (response)
|
||||
## HTTPS(S) ServerResponse (response)
|
||||
|
||||
### Response Methods & Properties
|
||||
|
||||
|
|
|
@ -16,5 +16,5 @@ os.homedir(); // CUrrent user home directory
|
|||
os.hostname(); // PC Name
|
||||
|
||||
os.cpus(); // Array of CPU info
|
||||
os.networkInterfaces(); // Array of Network Interfacecs info
|
||||
os.networkInterfaces(); // Array of Network Interfaces info
|
||||
```
|
||||
|
|
|
@ -15,7 +15,7 @@ process.arch // processor architecture
|
|||
## Functions
|
||||
|
||||
```js
|
||||
process.resourecUsage(); // resource usage for the current process
|
||||
process.resourceUsage(); // resource usage for the current process
|
||||
process.memoryUsage(); // memory usage of the Node.js process measured in bytes
|
||||
process.exit(code); // terminate the process synchronously with an exit status of code
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue