Now you can install GMOT-SSG!
Tags: opensource, javascript, beginners
Published: 2021-11-26 21:44:24


## Hi There,

Today I will talk about my first experience publishing a package to [npm]( https://www.npmjs.com/). Which means that now you can install it on your machine and use it!
My project is [here]( https://github.com/GMOTGIT/GMOT-SSG) in case you want to check it.
It is a Static Site Generator; it will take txt or md files as input and transform it in HTML!


--- 

## Why NPM?

Because I used JavaScript to build my SSG. It runs on Node so npm was the best choice for my case.
Besides, I have been using npm for some years now and I really wanted to try publishing something there.

--- 

## Preparing my SSG for publishing

Structuring your project is important before publishing it.
Keeping it organized and logical, update your scripts and tests, make sure it has no errors before deploying it to npm.
Because we have been working on it for the past couple months, it was almost ready to be published.
In any case I made tests on different machines to make sure it was working as intended


--- 

## The Process of Publishing my SSG
To be honest, this step was quite easy and simple.
I followed the steps on [npm docs](https://docs.npmjs.com/creating-and-publishing-unscoped-public-packages) on how to publish and to be honest it consisted in typing only one command in the console.
![Publish](https://i.ibb.co/89PJW2y/publish.png")

>obs.: The only problem I had was the fact that I had to create an account in NPM and validate it in order to publish my package.

## Patching!

After the project was published, I realized there was changes to be made, to apply this changes it was again quite simple.
I had to set a new version to my project and then publish it again

![Version]( https://i.ibb.co/RbvKFqy/version.png)

--- 

## Its There, Go take a Look!

Click [here](https://www.npmjs.com/package/gmot-ssg) to see my package page on npm!

![GMOT-SSG]( https://i.ibb.co/Tvnn4Bq/gmotssg.png)

To install it you need to type:

```
npm i gmot-ssg
```

And to run it simple type:

```
npx gmot-ssg -i yourFileHere.txt
```
--- 

## Testing with my Partner

This time my partner was [Mizuho]( https://github.com/MizuhoOkimoto).
Her SSG is [here]( https://www.npmjs.com/package/pajama-ssg).

Her package was well built, and we did not encounter many problems.
We encountered a yargs warning, saying that the ‘version’ word was a reserved word which she quickly solved.

Here is a image of it running fine:
![pajama](https://i.ibb.co/L1mDvw2/pajama.png)

When testing my SSG, Mizuho didn’t find many problems either, the program ran fine and work as intended. No errors, no warnings.
The only curious part was that her npm installs does not create a `node_modules` folder on the current directory, at least not for my case. 

It send the installed packages to a root directory somewhere in her file systems, something  that we could not figure out why at that moment, I bet it was some npm configuration, I believe a reinstall maybe will solve it.

When I tested it in different machines, the `node_modules` directory was there, so it was a little intriguing.

--- 

## Thank you! 

Thank you for reading this (David, I believe you are the only one :D), OSD Labs were fun and added a lot to me programming knowledges. 

There was a lot of work, I wish I had more time to dedicate my self more but with other 4 courses my time was really reduced.

If you read it until this line, send an emoji on the comments!