Setting up your own module
In this recipe, we'll be scaffolding our own module, that is, we will set up a typical file and directory structure for our module and learn how to initialize our project with the npm
CLI. We'll also create a GitHub repository to store our module code. GitHub is a hosting provider that allows users to store their Git-based repositories, where Git is a version control system.
The module we're going to make will expose an API that reverses the sentence we pass to it.
Getting ready
Let's make a new directory for our module and change into it:
$ mkdir reverse-sentence $ cd reverse-sentence
This recipe will also require you to have a GitHub account (https://github.com/join) to publish source code and an npm
account (https://www.npmjs.com/signup) to publish your module.
How to do it
In this recipe, we'll be using the npm
CLI to initialize our reverse-sentence
module:
- To get started, we must first initialize...