Inspiration

In the Rust community, they have a CLI tool called rustlings. Rust is notoriously hard to learn and that tool makes it easier but more importantly, fun! We wanted to build a similar tool for those looking to learn more about JavaScript.

What it does

It's an interactive command line tool that guides you through the ins and outs of JavaScript, one exercise at a time.

Getting Started

Clone the repository to your local machine, install the dependencies, and fill your brain with knowledge!

git clone https://github.com/XifeiNi/jslings.git
cd jslings
yarn
yarn jslings watch

Completing the Exercises

All exercises can be found in jslings/exercises/<concept>. For every topic we have multiple exercises for you to learn from basic to advanced.

Each exercises comes with some tests (jslings/src/__tests__/ for the curious). The CLI tool runs those tests to make sure your code does what it's supposed to. To start learning, simply run:

yarn jslings watch

From there, you'll see our command line interface. You can press c to test your code and update your progress as you move along!

Getting Hints

We've includes some hints for each exercises. Once you've started the jslings CLI, you can simply press h to receive a hint for the exercise you're currently on. Pressing h multiple times will cycle through the hints we have provided.

Contributing Guide

We welcome PRs to improve jslings and make it the best educational tool for learning Javascript!

Tests

The current code base allows you to add tests using yarn generate, this creates exercise as well as test files. To add your tests into jslings, all you have to do is -

  1. Create a function(with appropriate inputs) and export it from the js file
  2. Write a test for the function in the __tests__ folder
  3. Fire up your custom jslings! 🔥

P.S. If you'd like to see your tests added into jslings, feel free to submit PRs and label them as tests

CLI

The CLI is made using ink and we use jest for all our testing.

Before submitting the PRs for CLI and other things not related to tests, please label them as dev

How We built it

We built it using Ink (a tool for building CLI UIs with React) and Jest. Jest makes running tests easy, allowing us to check how the learners are doing as they progress through the curriculum.

Developed by members of Pod 1.0.3 - Edge Case Eagles

Built With

Share this project:

Updates