Skip to main content

Local development

To run the code for your challenge locally, you’ll need node installed. Our test runners use Node 18 (as of April 2024). The script for your challenge (like ./your_grep.sh) will automatically compile your code using node before executing it. It’ll look something like this:
#!/bin/sh

exec node app/main.js "$@"

File structure

  • The files for your solution are placed in the app/ directory.
  • app/main.js contains the main() function, which is what the test runner executes.

Adding more files

You can add more files and directories to app/. The test runner will include them when compiling your code. For example, if you add a file at app/foo.js, you could use it like so:
function foo() {
    console.log('Hello from foo!');
}

function bar() {
    console.log('Hello from bar!');
}

module.exports = { foo, bar };
We use the CommonJS syntax for importing and exporting of modules.

Adding dependencies

You can add dependencies to your project using npm.
Instructions for adding depedencies will be documented soon.