1642152600
O NPM é uma ferramenta de gerenciamento de pacotes de nós usada para baixar ou publicar pacotes de nós por meio do registro de pacotes npm . Ele vem junto com a node.js
configuração. npmjs
oferece vários pacotes de código aberto, como Lodash, React e Chalk para acelerar o processo de desenvolvimento.
Muitas vezes, os pacotes não são publicados no npmjs
registro, mas ainda podem ser usados em um projeto de nó usando a npm
ferramenta CLI. Este guia explica os detalhes da instalação de pacotes NPM públicos e privados do GitHub.
O npm
comando pode instalar pacotes públicos do npmjs
registro usando o install
comando:
npm install package-name package-name2
# or
npm i package-name package-name2
Às vezes, os pacotes não são publicados no npmjs
registro, mas ainda podem ser instalados usando o npm
. A npm
ferramenta pode acessar e instalar qualquer projeto de nó público como uma dependência do GitHub:
npm i https://github.com/user_name/node_project_name
O npm
comando tentará instalar o pacote usando git clone
. O npm
comando também pode instalar o pacote de diferentes estados do repositório GitHub usando um commit
valor de hash, que pode ser usado para instalar o pacote com um ID de confirmação:
npm install use_name/node_project#commit
Nota: O
@
símbolo representa onpm
escopo, uma técnica para agrupar todas as dependências de um usuário ou organização em uma pasta. Um nome de pacote sem@
e comname\name
padrão será tratado como um repositório de pacotes do GitHub.
O branch
nome pode ser usado para instalar uma ramificação como um pacote:
npm install use_name/node_project#branch_name
Da mesma forma, os nomes tag
ou version
podem ser usados para instalar uma versão específica de um pacote do GitHub:
npm install use_name/node_project@tag #user_name/node_project@release
npm install use_name/node_project@version #user_name/node_project@1.0.0
gist
também pode ser adicionado usando o id de a gist
:
npm install gist/gist_id
Um npm
pacote pode ser instalado de um repositório GitHub privado usando um link de repositório SSH. Os links SSH estão disponíveis apenas para usuários logados e podem ser usados para acessar os repositórios privados do seu GitHub. O protocolo SSH usa um algoritmo de criptografia de chave pública para autenticar o comando para acessar os repositórios do GitHub e precisa ser configurado com a conta do GitHub usando as chaves SSH. Um repositório privado do GitHub pode ser instalado usando o git+ssh
protocolo as:
npm install git+ssh://git@github.com:user_name/node_project.git
Observação: um pacote do GitHub deve ter um
package.json
arquivo significativo para ser instalado como um pacote.
O npm
comando install também fornece muitos outros recursos. Por exemplo, range
pode ser usado para instalar um pacote com um determinado intervalo para a versão:
npm install use_name/node_project">=1.0.0 <=2.0.0"
As versões geralmente são baseadas em semver . --force
instalará um pacote do repositório de pacotes remoto:
npm install pacakge_name --force
global
os pacotes são instalados na pasta global npm , que é acessível a todos os projetos:
npm install pacakge_name -global
O --ignore-scripts
sinalizador é usado para pular a execução do npm-scripts
bloco. E, finalmente, o uninstall
comando é usado para remover as dependências de projetos locais e o -g
sinalizador é usado para remover as dependências globais.
https://github.com/{USER}/{REPO}/tarball/{BRANCH}
npm i package-name
na npm
versão 5 ou superior sem a --save
opção. npm
5+ adicionará automaticamente o pacote como uma dependência.
A npm
instalação do GitHub é bastante útil para testar pacotes. Ele também oferece a flexibilidade de instalar qualquer branch, versão, tag e assim por diante. Boa codificação!
1603861600
If you have project code hosted on GitHub, chances are you might be interested in checking some numbers and stats such as stars, commits and pull requests.
You might also want to compare some similar projects in terms of the above mentioned stats, for whatever reasons that interest you.
We have the right tool for you: the simple and easy-to-use little tool called GitHub Stats.
Let’s dive right in to what we can get out of it.
This interactive tool is really easy to use. Follow the three steps below and you’ll get what you want in real-time:
1. Head to the GitHub repo of the tool
2. Enter as many projects as you need to check on
3. Hit the Update button beside each metric
In this article we are going to compare three most popular machine learning projects for you.
#github #tools #github-statistics-react #github-stats-tool #compare-github-projects #github-projects #software-development #programming
1595668020
GitHub is undoubtedly the largest and most popular social development platform in the world. According to its 2019 State of the Octoverse Report, GitHub is home to over 40 million, and the community keeps expanding every day.
As developers in this deeply interconnected community use open source code to build software, Github security should be a top priority. This is because extensive code re-use increases the risk of distributing vulnerabilities from one dependency or repository to another. As such, every contributor should focus on creating a secure development environment.
Here are eight security practices that GitHub users can follow to stay safe and protect their code:
Implementing proper access control is one of the best practices for enhancing security, not only on GitHub but in every other environment where code security is imperative.
GitHub offers several options that users can employ to reduce the risk of improper exposure. But to start with, it is important to employ the least privilege model where users are only granted necessary permissions.
Here are some basic access control guidelines that you should follow:
#tutorial #github #access control #software security #repository management #github issues #source code analysis #github apps #github enterprise #git best practices
1596161100
GitHub is undoubtedly the largest and most popular social development platform in the world. According to its 2019 State of the Octoverse Report, GitHub is home to over 40 million, and the community keeps expanding every day.
As developers in this deeply interconnected community use open source code to build software, Github security should be a top priority. This is because extensive code re-use increases the risk of distributing vulnerabilities from one dependency or repository to another. As such, every contributor should focus on creating a secure development environment.
Here are eight security practices that GitHub users can follow to stay safe and protect their code:
Implementing proper access control is one of the best practices for enhancing security, not only on GitHub but in every other environment where code security is imperative.
GitHub offers several options that users can employ to reduce the risk of improper exposure. But to start with, it is important to employ the least privilege model where users are only granted necessary permissions.
Here are some basic access control guidelines that you should follow:
#tutorial #github #access control #software security #repository management #github issues #source code analysis #github apps #github enterprise #git best practices
1595581560
Implementing proper access control is one of the best practices for enhancing security, not only on GitHub but in every other environment where code security is imperative.
GitHub offers several options that users can employ to reduce the risk of improper exposure. But to start with, it is important to employ the least privilege model where users are only granted necessary permissions.
Here are some basic access control guidelines that you should follow:
Leaking secrets to your GitHub repositories, either through code, configuration files, or commit messages, provides a gateway for attacks.
#tutorial #github #access control #software security #repository management #github issues #source code analysis #github apps #github enterprise #git best practices
1624347085
In this blog, we are going to learn how to create our own custom GitHub action using javaScript.
Automate, customize, and execute your software development workflows right in your repository with GitHub Actions. You can discover, create, and share actions to perform any job you’d like, including CI/CD, and combine actions in a completely customized workflow.
There are three types of actions: Docker container actions, JavaScript actions, and composite run steps actions.
Let’s create a Custom GitHub Action using JavaScript by creating a public repo, once the repo is created, we can clone it to our local machine using VS Code or GitPod. You need to have Node.js 12.x or higher and npm installed on your machine to perform the steps described here. You can verify the node and npm versions with the following commands in a VS Code or GitPod terminal.
node --version
npm --version
#github #github-tutorial #github-actions #github-trend