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 🙏

© 2026 – Pkg Stats / Ryan Hefner

maggio-baileys

v1.0.1

Published

I thought Baileys was kind of complicated... so I created this framework to make it simple 🙂

Readme

maggio-baileys

Um framework simples para começar a usar Baileys.

Iniciando

import {
  saveCreds,
  sendMessage,
  simpleMessage,
  Sock,
  reconnect
} from "maggio-baileys"

const startSock = async() => {

  try {

    const sock = Sock();

    sock.ev.process(

      async(events) => {

        if (events['connection.update']) {
          reconnect(events, startSock)
        };

        if (events['creds.update']) {
          await saveCreds()
        };

        if (events['messages.upsert']) {
          const upsert = events['messages.upsert'];

          if (upsert.type !== "notify") return;
          const message = upsert.messages[0];
          //if (message.key.fromMe) return;
          //if (message.key.remoteJid === "status@broadcast") return;

          const mek = simpleMessage(message)

          console.log(mek)

        }

      })

    return sock;

  } catch (err) {
    console.warn(err)
  }

}
startSock()

Enviando mensagens:

// mensagem de texto
sendMessage(sock, {
  to: sender,
  text: "Hello World"
})
}
// imagem/video
let mediaOptions = {
image: "./image.jpeg", // pode ser uma URL
caption: "Hello World"
}

sendMessage(sock, {
to: sender,
mediaOptions
})
// áudio
let mediaOptions = {
audio: "./audio.mp3"
}

sendMessage(sock, {
to: sender,
ptt: true, // enviar como nota de voz
mediaOptions
})
}
// botões
let buttons = [{
id: 1,
text: "button 1"
},
{
id: 2,
text: "button 2"
}];

let buttonOptions = {
text: "Hello World!",
footer: "description"
};

sendMessage(sock, {
to: sender,
buttons,
buttonOptions
})
// lista
let itens = [{
id: 1,
text: "opção 1"
},
{
id: 2,
text: "opção 2"
}];

let listOptions = {
title: "My List",
text: "Hello World",
footer: "Descrição"
}

sendMessage(sock, {
to: sender,
itens,
listOptions
})
// template
let buttons = [
  {
    text: "clique aki!",
    url: "https://google.com"
  },
  {
    text: "me ligue!",
    phone: "+12 34 5678910"
  },
  {
    id: "meu id",
    text: "like button"
    
  }
  ];
  
  let templateOptions = {
    text: "Hello World",
    footer: "Descrição"
  }
  
  sendMessage(sock, {
    to: sender,
    buttons,
    templateOptions
  }
// envie uma mensagem de botões com imagens
let buttons = [{
id: 1,
text: "button 1"
},
{
id: 2,
text: "button 2"
}];

let buttonOptions = {
image: "./example.jpeg",
text: "Hello World!",
footer: "description"
};

sendMessage(sock, {
to: sender,
buttons,
buttonOptions
})
/*
você pode compartilhar um produto/catálogo, mas você precisa tê-lo criado antes.
*/
let productOptions = {
  text: "Visite à minha loja",
  title: "Meu produto",
  thumb: "./image.jpeg",
  url: "url do catálogo.com"
};

sendMessage(sock, {
  to: sender,
  productOptions
})