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

orion.system

v1.3.2

Published

Discord Backup System

Downloads

4

Readme

Discord Backup System

By: ArviX#8443

Created for 0rion Project.

Installation

npm install discord-backup-system

Dev Note:

  • I changed the file type to axbs1. To make the transition easier for you, I made some functions: isBackupFile and makeBackupFileCompatible.
  • Added custom backup names!

Usage

Create a Backup

const backup = require('discord-backup-system');

// ... 
// Your Message Event / Command
backup.createBackup(message.guild, message.author.id, '/backup/', `${message.guild.id}-#{GEN_SHORT}#`).then(backupData => {
    message.channel.send(`This is your backup: \`${backupData.id}\``)
});

Usage

| Params | Type | Explication | Default | | ----- |------| ------- | ----- | | guild | Guild | Guild To Backup | None | | authorId | Snowflake | Author of the backup | None | | path | String | Path to save the backup | /backup/ | | name | String | Backup Name (#{GEN}# to generated a random string and #{GEN_SHORT}# to generate a shorter strings) | Generated |

Result

| Params | Type | Explication | | ----- |------| ------- | | id | String | Backup Id | | path | String | Backup Path (Path/backup_id.json) |

Backup Info

const backup = require('discord-backup-system');

// ... 
// Your Message Event / Command
backup.backupInfo(backup_id, '/backup/').then(backupData => {
    message.channel.send(`Backup Size: ${Math.floor(backupData.size)} MB`)
});

Usage

| Usage Params | Type | Explication | Default | | ----- |------| ------- | ----- | | backup_id | String | Backup Id to give info | None | | path | String | Path | /backup/ |

Result

| Result Params | Type | Explication | | ----- |------| ------- | | size | Number | Size in MB | | backup_id | String | Backup Id | | createdAt | Number | Creation timestamp | | guild_base_id | Snowflake | Backup guild id | | owner_id | Snowflake | Backup Guild owner id | | author_id | Snowflake | Backup creator id | | exists | Bool | Return if file exists (If Not only exists will be in results) |

Raw Backup Info

const backup = require('discord-backup-system');

// ... 
// Your Message Event / Command
backup.getBackupRAW(backup_id, message.guild, '/backup/');

Usage

| Usage Params | Type | Explication | Default | | ----- |------| ------- | ----- | | backup_id | String | Backup Id to give info | None | | path | String | Path | /backup/ |

Result

| Result Params | Type | Explication | | ----- |------| ------- | | backup_id | String | Backup Id | | path | String | Backup file path | | backup | Object | Backup file content | | exists | Bool | Return if file exists (If Not only exists will be in results) |

Get All Backups

const backup = require('discord-backup-system');

// ... 
// Your Message Event / Command
backup.getAllBackups(backup_id, message.guild, '/backup/');

Usage

| Usage Params | Type | Explication | Default | | ----- |------| ------- | ----- | | path | String | Path | /backup/ |

Result

| Result Params | Type | Explication | | ----- |------| ------- | | backups | Array | Array of backups infos (Same as backupInfo) | | time_elapsed | Number | Backup file path | | fetched | Number | Total of backup files fetched |

Backup Delete

const backup = require('discord-backup-system');

// ... 
// Your Message Event / Command
backup.deleteBackup(backup_id, "/backup/");

Usage

| Usage Params | Type | Explication | Default | | ----- |------| ------- | ----- | | backup_id | String | Backup Id | None | | path | String | Path | /backup/ |

Result

| Result Params | Type | Explication | | ----- |------| ------- | | deleted | Bool | Deleted or not | | backup_id | String | Backup Id | | exists | Bool | Return if file exists (If Not only exists will be in results) |

Load Backup

const backup = require('discord-backup-system');

// ... 
// Your Message Event / Command
backup.loadBackup(backup_id, message.guild, '/backup/');

Usage

| Usage Params | Type | Explication | Default | | ----- |------| ------- | ----- | | backup_id | String | Backup Id | None | | guild | Guild | Guild to load backup | None | | path | String | Path | /backup/ | debug | Bool | Debug Mode | false |

Result

| Result Params | Type | Explication | | ----- |------| ------- | | backup_id | String | Backup Id | | reversed_roles | Collection | Roles Equivalent | | reversed_channels | Collection | Channels Equivalent | | bans | Array | All Bans | | exists | Bool | Return if file exists (If Not only exists will be in results) |

Is A Backup File?

const backup = require('discord-backup-system');

// ... 
// Your Message Event / Command
backup.isBackupFile(backup_id, '/backup/', true);

Usage

| Usage Params | Type | Explication | Default | | ----- |------| ------- | ----- | | backup_id | String | Backup Id | None | | path | String | Path | /backup/ | | makeItCompatible | Bool | If the backup is compatible, it will create a valid backup file (.axbs1) | false |

Result

| Result Params | Type | Explication | | ----- |------| ------- | | isBackupFile | Bool | If the file is a valid backup file (.axbs1) | | isCompatible | Bool | If the file is compatible to reformating | | isReformated | Bool | If the file was reformated | | exists | Bool | Return if file exists (If Not only exists will be in results) |

Make Backup File Compatible

const backup = require('discord-backup-system');

// ... 
// Your Message Event / Command
backup.makeBackupFileCompatible(backup_id, '/backup/', true);

Usage

| Usage Params | Type | Explication | Default | | ----- |------| ------- | ----- | | backup_id | String | Backup Id | None | | path | String | Path | /backup/ | | deleteOld | Bool | If the backup is compatible, it will create a valid backup file (.axbs1) | true |

Result

| Result Params | Type | Explication | | ----- |------| ------- | | reformated | Bool | Is the file was reformated | | deletedOld | Bool | If the old backup file was deleted | | exists | Bool | Return if file exists (If Not only exists will be in results) |