Skip to content

London | 26-SDC-Nov | Tomislav Dukez | Sprint 3 | Implement shell tools - #717

Open
tomdu3 wants to merge 10 commits into
CodeYourFuture:mainfrom
tomdu3:implement-shell-tools
Open

tomdu3 wants to merge 10 commits into
CodeYourFuture:mainfrom
tomdu3:implement-shell-tools

Conversation

@tomdu3

@tomdu3 tomdu3 commented Nov 30, 2026

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Task code

CYF-1150

Changelist

Added JS implementation of ls, wc and cat.

@tomdu3 tomdu3 added 🏕 Priority Mandatory This work is expected 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Tools The name of the module. labels Nov 30, 2026
@tomdu3 tomdu3 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 30, 2026
@LonMcGregor LonMcGregor added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Dec 2, 2026
Comment thread implement-shell-tools/cat/cat.js Resolved
Comment on lines +19 to +21
for (const file of files) {
const data = await fs.readFile(file, "utf8");
catAllData += data;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much input must remain in memory before the first write when cat receives a large file?

To "like" or "dislike" this comment, please follow this link

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of it. Nothing is written until line 35. So peak memory is the total size of all input files, no matter how large the files are. I believe this is not that good, memory wise.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I've researched, cat is using streaming. Should I try to implement that, or is this solution ok?

@cyf-ai-code-reviewer cyf-ai-code-reviewer Bot added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Dec 2, 2026
@cyf-ai-code-reviewer

Copy link
Copy Markdown

The CYF AI review has left comments. It will only review a PR one time. When you have addressed these comments, please request review again and a volunteer will take a look.

@tomdu3 tomdu3 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Tools The name of the module. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants