Skills Expanded

Create a String Manipulation Library in JavaScript

What you'll learn

In this project we'll use modern JavaScript to refactor and extend a library for manipulating characters that mark the ends of lines in a string.

  1. Set up a command-line and module interface for the string transformation functions using JavaScript symbols and template tags.
  2. Refactor JavaScript modules using refactoring variable declarations and strings - we'll use string interpolation and raw string processing.
  3. Implement custom template tags to allow consumers of our library to quickly transform text.

Table of contents

Setup
15m
  • Setup your local environment for projects. We'll walk you through everything you need to know to setup your local instance and look around at the code you'll be using for this project.
Refactoring the Library
30m
  • In this module, we will refactor JavaScript modules related to the command-line interface of the library. This will involve refactoring variable declarations and strings used for help and usage text. By the end we'll use string interpolation and raw string processing. We'll also use JavaScript Symbols in the main module to provide globally unique values.
Implementing Template Tags
30m
  • In this module, we'll implement custom template tags to allow consumers of our library to quickly transform text. These tags will also enable consumers to disable line transformations on a given class using a global symbol. By the end we'll demonstrate the use of several string methods by writing tests that ensure our template tags work as expected.

Course FAQ

What is string manipulation in JavaScript?

String manipulation helps developers automate certain parts of working with string values. This particular project will help devs with manipulating characters that mark the ends of lines in a string.

Who is this project for?

This project is great for Node.js and JavaScript beginners looking to start working with string manipulation functions.

What will I learn in this project?

Start with a walkthrough of setting up your environment, learn refactoring variable declarations, string interpolation and raw string processing, and finish by writing test to ensure your template tags work as expected.

What prerequisites do I need?

This beginner-level project is designed for developers with a basic working knowledge of Node.js and/or JavaScript.

About the author

AJ is a software developer who is passionate about technical education. He loves creating with code and volunteering with youth robotics programs.

Ready to upskill? Get started