Skip to content

Commit 1c259c3

Browse files
authored
Merge pull request #4 from codecrafters-io/CC-1274-js
Add support for Javascript
2 parents 4513386 + 24ca530 commit 1c259c3

34 files changed

+365
-9
lines changed

compiled_starters/go/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
This is a starting point for Go solutions to the
44
["Build Your Own Shell" Challenge](https://app.codecrafters.io/courses/shell/overview).
55

6-
_Add a description of your course here_
6+
In this challenge, you'll build your own POSIX compliant shell that's capable of
7+
interpreting shell commands, running external programs and builtin commands like
8+
cd, pwd, echo and more. Along the way, you'll learn about shell command parsing,
9+
REPLs, builtin commands, and more.
710

811
**Note**: If you're viewing this repo on GitHub, head over to
912
[codecrafters.io](https://codecrafters.io) to try the challenge.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
![progress-banner](https://codecrafters.io/landing/images/default_progress_banners/shell.png)
2+
3+
This is a starting point for JavaScript solutions to the
4+
["Build Your Own Shell" Challenge](https://app.codecrafters.io/courses/shell/overview).
5+
6+
In this challenge, you'll build your own POSIX compliant shell that's capable of
7+
interpreting shell commands, running external programs and builtin commands like
8+
cd, pwd, echo and more. Along the way, you'll learn about shell command parsing,
9+
REPLs, builtin commands, and more.
10+
11+
**Note**: If you're viewing this repo on GitHub, head over to
12+
[codecrafters.io](https://codecrafters.io) to try the challenge.
13+
14+
# Passing the first stage
15+
16+
The entry point for your `shell` implementation is in `app/main.js`. Study and
17+
uncomment the relevant code, and push your changes to pass the first stage:
18+
19+
```sh
20+
git add .
21+
git commit -m "pass 1st stage" # any msg
22+
git push origin master
23+
```
24+
25+
Time to move on to the next stage!
26+
27+
# Stage 2 & beyond
28+
29+
Note: This section is for stages 2 and beyond.
30+
31+
1. Ensure you have `node (21)` installed locally
32+
1. Run `./your_shell.sh` to run your program, which is implemented in
33+
`app/main.js`.
34+
1. Commit your changes and run `git push origin master` to submit your solution
35+
to CodeCrafters. Test output will be streamed to your terminal.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Uncomment this block to pass the first stage
2+
// const readline = require("readline");
3+
4+
// You can use print statements as follows for debugging, they'll be visible when running tests.
5+
console.log("Logs from your program will appear here!");
6+
7+
// Uncomment this block to pass the first stage
8+
// const rl = readline.createInterface({
9+
// input: process.stdin,
10+
// output: process.stdout,
11+
// });
12+
//
13+
// rl.question("$ ", (answer) => {
14+
// rl.close();
15+
// });
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Set this to true if you want debug logs.
2+
#
3+
# These can be VERY verbose, so we suggest turning them off
4+
# unless you really need them.
5+
debug: false
6+
7+
# Use this to change the JavaScript version used to run your code
8+
# on Codecrafters.
9+
#
10+
# Available versions: nodejs-21
11+
language_pack: nodejs-21

compiled_starters/javascript/package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@codecrafters/build-your-own-shell",
3+
"version": "1.0.0",
4+
"description": "Build your own Shell challenge, from CodeCrafters",
5+
"main": "main.js",
6+
"scripts": {
7+
"dev": "node app/main.js"
8+
},
9+
"keywords": [
10+
"build-your-own-x"
11+
],
12+
"author": "",
13+
"license": "MIT",
14+
"dependencies": {}
15+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
#
3+
# DON'T EDIT THIS!
4+
#
5+
# CodeCrafters uses this file to test your code. Don't make any changes here!
6+
#
7+
# DON'T EDIT THIS!
8+
exec node app/main.js "$@"

compiled_starters/python/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
This is a starting point for Python solutions to the
44
["Build Your Own Shell" Challenge](https://app.codecrafters.io/courses/shell/overview).
55

6-
_Add a description of your course here_
6+
In this challenge, you'll build your own POSIX compliant shell that's capable of
7+
interpreting shell commands, running external programs and builtin commands like
8+
cd, pwd, echo and more. Along the way, you'll learn about shell command parsing,
9+
REPLs, builtin commands, and more.
710

811
**Note**: If you're viewing this repo on GitHub, head over to
912
[codecrafters.io](https://codecrafters.io) to try the challenge.

0 commit comments

Comments
 (0)