Socket
Socket
Sign inDemoInstall

discloud

Package Overview
Dependencies
97
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    discloud

All-purpose discord !! We have created a database-like library by taking advantage of the features of Discord, a chat application. I'm using discord.js.


Version published
Maintainers
1
Install size
2.48 MB
Created

Readme

Source

1. Why use discloud :question:  ©X

If you use discord, you can view it directly without using space to store the data,
so it is easy to manage.
Increased storage / retrieval speed.

:scroll: table of contents :scroll:

  • HOW TO USE
  • INFOMATION

:information_source: 2. How to use

Sample Code
(async function(){

    const cloud = require('discloud');
    const DB = new cloud;

    /**
     * How to set when DB is generated
     * -It can also be set using DB.setting()
     */
    const DB = new cloud({
        encode:{//encode settings
            use:true,//encode = on
            key:{
                keyA:"(32 alphanumeric characters)",
                keyB:"(16 alphanumeric characters)"
            }
        },
        token:"Your token is here",
        server:"Your Server ID (This server id's server will be a database)"
    });

    /**
     * How to use encode
     */
    DB.encodOn();//Turn on encoding
    DB.setKey("(32 alphanumeric characters)","(16 alphanumeric characters)");//set key

    const client = await DB.create("Your token is here",{
        server:"Your Server ID (This server id's server will be a database)",
        //DB.setServer("ID");//You can also set this way
        name:"DataTable's name"
    },
    {}//The value to be set first when creating db
    );
    client.on('error',err=>{
        console.log(err.message);//throw client's error here
    })
    client.on('ready',async ()=>{//client ready
        console.log('ready...');

        /**
         * Emphasis is placed on efficiency and safety.
         * The method that directly operates the DB is
         * Only set, get and create are available.
         * Other methods to change settings (such as switching encryption)
         * There is.
         */
        await DB.set("text")//set data in database
        .then(async()=>{
            console.log(await DB.get())
            //text
        }); 
        /**
         * Notify when data set is complete
         */
        client.on('set',data=>{
            data = data[0];//main content (data[1] is this process's key)
            console.log(data.processTime);//Time it took to set
            console.log(data.setData);//Seted data
            console.log(data.info);// = DB.info()
        });
        client.on('get',data=>{
            var info = data[0];
            //main content
            var key = data[1];
            //this process's key
        });
        /**
         * Notify once when nothing is written.
         */
        client.once('writeEnd',async ()=>{
            console.log(await DB.get());
        });

        DB.info();
        //You can get Your DB's infomations
    });
})();

3. INFOMATION

This software is released under the MIT License, see LICENSE.txt.

UPDATA :heavy_plus_sign:

2020:10/10 Significant improvement
2020:10/18 Revised again
2020:11/14 Significant weight reduction
2020:11/17 Fixing a terrible mistake

:white_check_mark: Operating environment

language

Node.js

Dependencies

discord.js

:information_source: I recommend having a server dedicated to this database library.

About defects etc :email:

Contact " Official.neoxbot@gmail.com "

Keywords

FAQs

Last updated on 17 Nov 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc