npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@labz/semver

v0.0.5

Published

Testes de publicação de pacotes npm na org @labz

Downloads

5

Readme

labz-semver-npm

Testes de publicação de pacotes npm na org @labz

npmjs.com é utilizado para armazenar e versionar assets, mas não possui CDN próprio. Para isso existem duas soluções, jsdelivr.net e unpkg.com

O pacote público npm se chama: @labz/semver utilizando Versionamento Semântico 2.0.0

Setup

O mínimo necessário para publicar um package npm é o seguinte:

mkdir semver
cd semver
npm init --scope=@labz --force
echo 'alert("@labz/[email protected]")' > index.js
npm publish --access public

output:

npm notice
npm notice 📦  @labz/[email protected]
npm notice === Tarball Contents ===
npm notice 28B  index.js
npm notice 340B package.json
npm notice 964B README.md
npm notice === Tarball Details ===
npm notice name:          @labz/semver
npm notice version:       0.0.0
npm notice package size:  842 B
npm notice unpacked size: 1.3 kB
npm notice shasum:        36e0ffc1b9018b9d5b9f7fd70b31946194138248
npm notice integrity:     sha512-6fpiPOJHA7MQq[...]NFqIPEB0OZlwQ==
npm notice total files:   3
npm notice
+ @labz/[email protected]

Publish

Utilizar tag para não atrapalhar versões em produção: (dev, test, beta, alpha, next. A tag padrão é latest)

npm publish --tag dev

curl -Li https://unpkg.com/@labz/semver@dev

Apenas ver quais arquivos serão enviados no package:

npm publish --dry-run

CDN

jsdelivr faz cache que precisa ser purged para limpar

curl -I https://cdn.jsdelivr.net/npm/@labz/semver
HTTP/2 200
access-control-allow-origin: *
access-control-expose-headers: *
timing-allow-origin: *
cache-control: public, max-age=604800, s-maxage=43200
x-content-type-options: nosniff
strict-transport-security: max-age=31536000; includeSubDomains; preload
content-type: application/javascript; charset=utf-8
etag: W/"f3-/lk7X7oGrYFrvMYtCzq4XR/K2vY"
accept-ranges: bytes
date: Tue, 14 Jul 2020 05:15:14 GMT
age: 564
x-served-by: cache-fra19160-FRA, cache-gru17139-GRU
x-cache: HIT, HIT
vary: Accept-Encoding
content-length: 243

unpkg redireciona para a versão final, fazendo cache no browser de 1 minuto e no CDN de 10 minutos.

curl -LI https://unpkg.com/@labz/semver
HTTP/2 302
date: Tue, 14 Jul 2020 05:16:38 GMT
content-type: text/plain; charset=utf-8
content-length: 41
access-control-allow-origin: *
cache-control: public, s-maxage=600, max-age=60
location: /@labz/[email protected]
vary: Accept
x-cloud-trace-context: dc84e19e140a5953ce518ce94806e67c
cf-cache-status: HIT
age: 34
cf-request-id: 03ed59f7690000f66f232b6200000001
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
server: cloudflare
cf-ray: 5b28c5d24969f66f-GRU

HTTP/2 302
date: Tue, 14 Jul 2020 05:16:38 GMT
content-type: text/plain; charset=utf-8
content-length: 50
access-control-allow-origin: *
cache-control: public, max-age=31536000
location: /@labz/[email protected]/index.js
vary: Accept
x-cloud-trace-context: 7875e958b1a50645050087c061365fe0
cf-cache-status: HIT
age: 703
cf-request-id: 03ed59f7870000f66f232b8200000001
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
server: cloudflare
cf-ray: 5b28c5d27986f66f-GRU

HTTP/2 200
date: Tue, 14 Jul 2020 05:16:38 GMT
content-type: application/javascript; charset=utf-8
vary: Accept-Encoding
access-control-allow-origin: *
cache-control: public, max-age=31536000
last-modified: Sat, 26 Oct 1985 08:15:00 GMT
etag: W/"1c-6QAw92pHlwg0xuXK4Rodk9Nmqxc"
x-cloud-trace-context: b811446b34cffe5c6cc130c74299819e
cf-cache-status: HIT
age: 888
cf-request-id: 03ed59f7a60000f66f232c0200000001
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
server: cloudflare
cf-ray: 5b28c5d2a9b8f66f-GRU