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 🙏

© 2025 – Pkg Stats / Ryan Hefner

shouts

v0.0.9

Published

Shouts ======= An example of NPM Module

Downloads

39

Readme

Shouts

An example of NPM Module

Este módulo contiene 2 funcionalidades bien básicas. Lo usaremos de ejemplo para los ejercicios de linkear un módulo localmente, publicar en el registro público y en uno privado.

HOW TO

ejercicio 1

  1. Clonar el repo del módulo: [email protected]:dudesl/shouts.git
  2. modificar el campo name del package.json de shouts con un nombre custom, para que no haya conflicto de nombres en el repo público.
  3. Exponer las 2 funciones de shouts: cow y voice. PISTA! http://www.sitepoint.com/understanding-module-exports-exports-node-js/
  4. Linkearlo localmente PISTA! http://vansande.org/2015/03/20/npm-link/

ejercicio 2

  1. Crear una carpeta para el ejercício. Vamos a llamarla app.
  2. cd app && npm init para inicializar package.json.
  3. Crear index.js con el siguiente contenido http://goo.gl/86khsb
  4. npm install -> nos da error pq el modulo no existe en el repo público.
  5. npm link shouts para que linkee el módulo localmente.
  6. npm install para instalar el resto de dependencias.
  7. Ejecutar index.js, veremos que carga la dependencia como corresponde.

ejercicio 3

** Publicar en repo público **

  1. Crear un usuario en NPM https://www.npmjs.com/signup
  2. npm login para registrar las credenciales
  3. cat ~/.npmrc para chequear el authToken correspondiente
  4. npm publish para publicar

ejercicio 4

** Una vez publicado **

  1. ir al directorio app.
  2. npm unlink shouts para romper el symlink local.
  3. npm install traerá el módulo desde el registro público.

ejercicio 5

** Hacer disponible un bin script**

  1. copiar el index.js de app al modulo con nombre bin.js
  2. completar el campo "bin" del package.json del módulo
    "bin": {
      "shouts": "bin.js"
    }
  3. cambiar la versión en el package.json
  4. npm publish para actualizar el modulo publicado
  5. npm install -g shouts para instalar globalmente el modulo.
  6. shouts deberia estar disponible.

ejercicio 6

Publicar en repo privado

  1. Setear el registro privado. 2 formas de hacerlo
  • npm set registry http://registry.npm.ml.com Esto lo setea en ~/.npmrc, o sea, para TODOS los módulos. Cada vez que hagamos npm publish
  • hacer un .npmrc local al proyecto con el siguiente contenido
    registry = http://registry.npm.ml.com/
    spin = false
  1. Loguearse con el user del registro privado (pedir por mensaje privado)
  • npm add user
  1. publicar comun y corriente con npm publish

Cualquier conflicto con alguno de los comandos npm de este paso, usar el sufijo --registry http://registry.npm.ml.com