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

@harmonyland/harmony

v2.9.0

Published

An easy to use and advanced Discord API Library for Deno and Node.js

Downloads

6

Readme

banner

  • Lightweight and easy to use
  • Complete Object-Oriented approach
  • Slash Commands supported
  • Built-in Commands framework
  • Customizable Caching, with Redis support
  • @decorators supported
  • Made with ❤️ in TypeScript

Usage (Deno)

You can import the package from https://deno.land/x/harmony/mod.ts (with latest version) or can add a version too, and raw GitHub URL (latest unpublished version) https://raw.githubusercontent.com/harmonyland/harmony/main/mod.ts too.

We also have a (fancy) custom registry for importing Harmony! It's at code.harmony.rocks, example import URL: https://code.harmony.rocks/v2.6.1.

Usage (Node.js)

You can install and use the NPM package published under @harmonyland/harmony.

Documentation

Documentation is available main branch or latest stable version (v2.6.1). You can also check out the guide.

Example

For a quick example, run this:

deno run --allow-net https://deno.land/x/[email protected]/examples/ping.ts

And input your bot's token.

Here is a small example of how to use harmony,

import {
  Client,
  Message,
  GatewayIntents
} from 'https://deno.land/x/[email protected]/mod.ts'

const client = new Client({
  intents: [
    'GUILDS',
    'DIRECT_MESSAGES',
    'GUILD_MESSAGES'
  ],
  // token: optionally specify, otherwise DISCORD_TOKEN from env is used
})

// Listen for event when client is ready (Identified through gateway / Resumed)
client.on('ready', () => {
  console.log(`Ready! User: ${client.user?.tag}`)
})

// Listen for event whenever a Message is sent
client.on('messageCreate', (msg: Message): void => {
  if (msg.content === '!ping') {
    msg.channel.send(`Pong! WS Ping: ${client.gateway.ping}`)
  }
})

// Connect to gateway
client.connect()

Or with CommandClient!

import {
  CommandClient,
  Command,
  CommandContext,
  GatewayIntents
} from 'https://deno.land/x/[email protected]/mod.ts'

const client = new CommandClient({
  prefix: '!',
  intents: [
    'GUILDS',
    'DIRECT_MESSAGES',
    'GUILD_MESSAGES'
  ],
  // token: optionally specify, otherwise DISCORD_TOKEN from env is used
})

// Listen for event when client is ready (Identified through gateway / Resumed)
client.on('ready', () => {
  console.log(`Ready! User: ${client.user?.tag}`)
})

// Create a new Command
class PingCommand extends Command {
  name = 'ping'

  execute(ctx: CommandContext) {
    ctx.message.reply(`pong! Ping: ${ctx.client.gateway.ping}ms`)
  }
}

client.commands.add(PingCommand)

// Connect to gateway
client.connect()

Or with Decorators!

import {
  event,
  CommandClient,
  command,
  CommandContext,
  GatewayIntents
} from 'https://deno.land/x/[email protected]/mod.ts'

class MyClient extends CommandClient {
  constructor() {
    super({
      prefix: ['!', '!!'],
      caseSensitive: false,
      intents: [
        'GUILDS',
        'DIRECT_MESSAGES',
        'GUILD_MESSAGES'
      ],
      // token: optionally specify, otherwise DISCORD_TOKEN from env is used
    })
  }

  @event()
  ready(): void {
    console.log(`Logged in as ${this.user?.tag}!`)
  }

  @command({ aliases: 'pong' })
  Ping(ctx: CommandContext): void {
    ctx.message.reply('Pong!')
  }
}

new MyClient().connect()

Discord

Need support? Join our Discord Server!

Harmony Discord Server

Maintainer

@Helloyunho

Contributing

See the contributing file!

Pull requests are welcome!

Small note: If editing the README, please conform to the standard-readme specification.

License

MIT © 2020-2023 Harmony Land

Made with ❤ by Harmony Land