How to use github package

1. Write in front

Last time, the author introduced to you how to use the gitlab repository as an npm private package. For details, please refer to my blog post address https://ift.tt/jSZIpx5, it can be used, but Not elegant enough, for example, if you want to know the version of that package, it is not very intuitive to reflect in package. json . Many days ago, by chance, I was discovered and liked by the sponsor of Party A. After being away from the back end for a long time, I bit the bullet and wrote some interview questions about Node. For details, please refer to my blog post https:// https://ift.tt/Hdgtr7v, after passing the interview, I went to a first-line invoicing center in a certain place to do a part-time job on weekends. It’s quite interesting, hehe, while the boss pays me wages, I can learn to contact New fields and knowledge, no, in which I learned a method for managing npm private packages based on gitlab.

2. This is a bad story

Several months ago, I once wrote a project on github. It was mainly based on leetcode and used to brush questions. There are probably dozens of questions written. For language, I wrote it in ts, and each question also has Its unit tests are all configured for you. If you are interested, you can clone, star, and fork to play https://ift.tt/ecy7AHM. If you are not familiar with ts , in fact, a year ago I also used js to brush some questions, you can take a look at this https://ift.tt/uUoJBEM, mainly because I was very busy for a while, so I didn’t have the time and energy to do this, and then I stopped And then the part-time job also took up part of my time. I can get a little money to dance with a group of people by myself, so I will definitely choose the latter, so this project is unfinished. Speaking of unfinished, I am in 2013 I saw an unfinished building near me in about 2000. Thanks to the development of Line 3, this unfinished building came to life again last year. I think I may be in this mode in the future, and maybe one day I will activate it again. In this project, in fact, I am more inclined to output 3-7 questions a month to moisten my brain. After all, what you can do and what you can do and teach others are two different things.

3. Take my unfinished building project as an example to conduct GitHub package package test

I have to choose a warehouse to try. I looked at my warehouse list, and I decided to let the unfinished building apply for the competition! ! !

I don’t know why, I can’t enter Chinese on that picture, so I just wrote a few sentences in English, hoping to know.

3.1. Create AccessToken of github

Step1: Click the settings of the user avatar to enter the settings page

Step2: Click on Developer Settings to enter the developer configuration page

Step3: Click on personal access token to enter the token configuration page, then click on generate token to create a new token

Step4: Fill in the required token information, pull it to the bottom and click the generate new token button. You need to pay attention here. This token will only appear once, so after generation, you can copy and paste it to a place where you can save it for him.

3.2. Use npm to log in to the github package website

Step 1: Log in to the package website of github package npm login --registry=https://npm.pkg.github.com

Step 2: …

The post github package usage tutorial first appeared on Lenix Blog .

This article is reprinted from https://blog.p2hp.com/archives/9011
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment