Publishing a module
In this recipe, we'll prepare our module to published; then, we'll publish it as a scoped package.
Getting ready
We will publish our hsl-to-hex
module that we've been working on in the preceding recipes. We'll also want the (original) tests we wrote in the Adding tests portion of the There's more section of the Writing module code recipe.
If we don't have an npmjs.org account, we'll need to head over to https://www.npmjs.com/signup and get an account. Keep the username handy; we will need it.
How to do it...
If we've just signed up for an npm account (as explained in the Getting ready section), we'll want to authorize our npm client with npmjs.org.
On the command line, we simply need to run this:
npm login
Then, supply the username, password, and email address we signed up with.
Every module should have a README explaining how it works.
Let's create a Readme.md
file with the following markdown:
# hsl-to-hex Convert HSL colors to RGB colors in hex format. ## Install ```sh npm...