forked from AlreadyBored/node-nodejs-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Task1 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Duude92
wants to merge
31
commits into
main
Choose a base branch
from
task1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…how to properly complete the task
…ith message of succesfully filled file
This reverts commit e0a2bb8.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solution for task1
Dealine date: 2025-04-29 03:00
Self check:
File system (src/fs)












+6 create.js:
File creates and filled successfully
Fails with error if file already created
+10 copy.js implemented properly
Successfully copies folder with its content (including subfoler with files in it, recursively)
+10 rename.js implemented properly
Successfully renames file && proper handling existing destination/missing source
+6 delete.js implemented properly
Removing file using function fs.unlink, proper handling of missing file to delete
+6 list.js implemented properly
Proper listed files from 'files' folder using fs.readdir function, and handle missing directory.
+6 read.js implemented properly
Read of file using fs.readFile function
Command line interface(src/cli)
+6 env.js implemented properly
Properly handled environment variables. Output contains only entries started with "RSS". Values are separated with semicolon._
+6 args.js implemented properly
Properly handled console arguments. Values are separated with coma.
Modules(src/modules)
+20 cjsToEsm.cjs refactored properly
require functions replaced with import, json read with 'await import' instead of require function, previously implemented with JSON.parse, which returns json object directly (without 'default' property) (see the comments). Exported objects with esm 'export' statement
Hash (src/hash)
+10 calcHash.js implemented properly
Function implemented using crypto.createHash('sha256') function. Initially missed "using Streams API", so later (28.04) reworked with streams and piping.
Streams (src/streams)
+10 read.js implemented properly
Successfully read file using streams and piping.
+10 write.js implemented properly
Easiest implementation in two lines.
+10 transform.js implemented properly
Implemented transformation using Transform object.
Zlib (src/zip)
+10 compress.js implemented properly
+10 decompress.js implemented properly
Nothing to comment, just implementation of compressing/decompressing module using streams and piping
Worker Threads (src/wt)
+10 worker.js implemented properly
Added response from worker to main thread using parentPort with results of nthFibonacci with load from workerData
+30 main.js implemented properly
Implemented method to perform per-thread calculations of Fibonacci numbers for i+10 iterations, ordered with ascending order, since creating promises synchronously, link
Child Processes (src/cp)
+10 spawns child process
+10 child process stdin receives input from master process stdin
+10 child process stdout sends data to master process stdout
Implemented function using child_process.fork method. Piped child and parent stdin/stdout channels
Result:
Basic scope: 136/136
Advanced scope: 70/70
Forfeits: 0