Publicando meu primeiro pacote no npm.
Gerador de cores aleatórias
$ npm install @guilhermerodrigues680/random-color-generator
// CommonJS
const randomColorGenerator = require('@guilhermerodrigues680/random-color-generator');
// ES6 modules
import randomColorGenerator from '@guilhermerodrigues680/random-color-generator';
https://cdn.jsdelivr.net/npm/package@version/file
<script src="https://cdn.jsdelivr.net/npm/@guilhermerodrigues680/random-color-generator"></script>
Note: we recommend using npm for projects that support it
https://cdn.jsdelivr.net/gh/user/repo@version/file
<script src="https://cdn.jsdelivr.net/gh/guilhermerodrigues680/[email protected]/dist/random-color-generator.js"></script>
- unpkg is a fast, global content delivery network for everything on npm
unpkg.com/:package@:version/:file
<script src="https://unpkg.com/@guilhermerodrigues680/random-color-generator"></script>
- Load optimized npm packages with no install and no build tools.
https://cdn.skypack.dev/@scope/package-name
<script type="module">
import guilhermerodrigues680RandomColorGenerator from 'https://cdn.skypack.dev/@guilhermerodrigues680/random-color-generator';
</script>
Anexe um / no final de um URL para ver uma lista de todos os arquivos em um pacote.
https://cdn.jsdelivr.net/npm/package@version/folder/
https://cdn.jsdelivr.net/gh/user/repo@version/folder/
unpkg.com/:package@:version/:file/
jsdelivr: add ".min" to any JS/CSS file to get a minified version, if one doesn't exist, we'll generate it for you
https://cdn.jsdelivr.net/npm/package@version/file.min.js
https://cdn.jsdelivr.net/gh/user/repo@version/file.min.js
Skypack:
View metadata about any package.
https://cdn.skypack.dev/:packageSpecifier?meta
Minified (?min)
https://cdn.skypack.dev/preact?min
Package Export
https://cdn.skypack.dev/preact/hooks
# Init
$ npm set init-author-email <user.email.com>
$ npm set init-author-name <user>
$ npm set init-license MIT
$ npm adduser
$ npm init
# Publish
$ npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
$ npm publish
$ npm publish --access=public
$ npm unpublish @guilhermerodrigues680/[email protected]
$ npm deprecate @guilhermerodrigues680/random-color-generator@"< 1.0.0" "bug crítico corrigido em v1.0.0"
Este projeto segue o seguinte o Versionamento Semântico 2.0.0.
npm run live-server
- Inicia um servidor com hot reload na porta 8080.npm run server
- Inicia um servidor na porta 8080.npm run build-browser
- Compila o arquivosrc/browser.js
para distribuição.
O código fonte do projeto está sob a licença MIT License, disponível no arquivo LICENSE deste projeto.
Guilherme Rodrigues - github.com/guilhermerodrigues680