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

channel-backup

v1.2.5

Published

A command line / actions tool to help Community Managers keep their information channels updated.

Downloads

19

Readme

channel-backup

GitHub branch checks state GitHub repo size GitHub Repo stars npm node-current

A command line tool to help Community Managers keep their information channels updated.

Notes on progress can be found on the project board.

I am aware this program does not follow the regular conventions of an interface, but I have done my best to ensure that it is accessable with regular scripts like you would use the terminal. That said, I discourage it with upmost concern. In theory, this can be applied to monorepo setups where multiple channels are setup with webhooks to keep their information up to date, all that would need to be done is run the command across all packages.

Usage

The cache.json file that contains message IDs of all messages sent in the previous sequence (local updated). For any data structure files (including yml and json) are following the structural pattern of WebhookMessageOptions (discord.js). cache.json is both fetched and dumped wherever the {directory} was set to.

Usage
  $ channel-backup [options]

Options
  -h, --help       Show this help.
  -v, --version    Show version.
  -c, --config     Specify config file (defaults to '{directory}/config.json').
  -m, --mode       Specify mode (replace, =update)
    * replace: replace all messages in the channel.
    * =update: update all messages in the channel (default).
  -d, --directory  Specify directory to backup (defaults to current working directory).
  -s, --silent     Don't output anything.

Config specifications

{
  "$schema": "https://github.com/TinkerStorm/channel-backup/raw/main/schemas/config.json",
  "webhook": "https://discord.com/api/webhooks/:id/:token",
  "files": [
    "./path/to/file.md",
    "./path/to/*.md"
  ],
  "authors": {
    "sudojunior": "https://github.com/sudojunior.png"
  }
}
  • $schema - uses the schema stored at the primary branch to help build the configuration

    Some properties may not exist here if they are added in plugins.

  • webhook - either a webhook uri as string or an object { id, token }

    Alternatively, this can be omitted in favor of using an environment variable. At present, dotenv is not used to load the environment variables from a .env.

  • files - An array of files which are sent through the webhook (can either be direct files or globs)
  • authors (optional, plugin) - A map of authors to avatars.

    When using 'username' or 'embeds.*.author.name' in full payloads (yml, json), this map will be used if the related avatar or icon slot is not filled.

  • threadID - The ID of the thread to send the message to.
  • thread_name - (Forums only) The name of the thread to send the message to. Only used if threadID is not provided.

    This program will overwrite the config file when the new threadID is returned from it's first request.

Sequence Flow

File Support

| Extensions | Description | | --- | --- | | .md / .txt | Markdown { content } | | .json / .yml / .yaml | Raw payload | | .png / .jpg / .jpeg / .gif / .webp | Image { attachment, name: "{name}.{ext}" } |

Raw files are expected to use a file option that may look like { path: "./path/to/file.go", raw: true }, using payload structure of Image. While raw is not supported yet, it is planned to be added in the future.

While there is no support for template engines like nunjucks, ejs or liquid - with the intention to move to plugins, these could become plugins themselves. The theorised event hooks / listeners will reinforce the design by having them listen for certain files (native file handlers will be included as standard but follow the same internal design as plugins).


Future Advancements

  • Custom webhook wrapper
  • Plugin support (templates, payload 'injection')
  • GitHub Actions (#1)
  • CLI refactor for standardized keywords (create, run, purge, etc.)
  • Multi language support? (python, go, rust)
  • Move to TypeScript
  • Demos, Templates, Show & Tell, etc.

License

This package uses the MIT license.


Support & Share

  • If you use this package, we'd love to hear about how you use it.
  • If you need help or have a suggestion, open an issue or contact us on Discord.