Store data using zero width spaces! Might be useful for discord bots.

Overview

ZWSP

Store data using zero width spaces! Might be useful for discord bots.


Installation

npm i zwsp

Usage

Import the library:

import { encode, decode} from 'zwsp'; // typescript

const { encode, decode } = require('zwsp'); // node.js

Encoding:

encode("Hello World!");
encode(3.14159265359);
encode(12345678987654321n);
encode([ 123, "Hello", 321, "World" ]);
encode({ a: 123, b: 321, c: "example", d: [ "Hello", "world" ] });

Decoding:

decode(...);

// will also keep the type:
decode(encode("123")); // "123" (string)
decode(encode(123)); // 123 (number)
decode(encode([1, 2, 3])); // [1, 2, 3] (object)

Why?

tbh, I don't really know. This might be useful for discord bots that don't use any database but still need to store certain information (for example, bots hosted on heroku).

That was just a random idea that came to my mind at 3 am lol.

It works because the characters this library uses are actually a zero-width spaces and are invisible. Users still can access the info you stored, but a regular user won't notice anything.


Other examples

Visit examples directory for other examples (with discord.js)

You might also like...

👌A useful zero-dependencies, less than 434 Bytes (gzipped), pure JavaScript & CSS solution for drop an annoying pop-ups confirming the submission of form in your web apps.

👌A useful zero-dependencies, less than 434 Bytes (gzipped), pure JavaScript & CSS solution for drop an annoying pop-ups confirming the submission of form in your web apps.

Throw out pop-ups confirming the submission of form! A useful zero-dependencies, less than 434 Bytes (gzipped), pure JavaScript & CSS solution for dro

Aug 24, 2022

Zero Two Bot,A fully Modular Whatsapp Bot to do everything possible in WhatsApp by Team Zero Two

Zero Two Bot,A fully Modular Whatsapp Bot to do everything possible in WhatsApp by Team Zero Two

🍭 𝗭𝗲𝗿𝗼 𝗧𝘄𝗼 𝗠𝗗 🍭 A Moduler WhatsApp Bot designed for both PM and Groups - To take your boring WhatsApp usage into a whole different level. T

Dec 25, 2022

a full functional discord bot to send moomoo.io bots

MooMooBot a discord bot which does moomoo.io stuff commands !send server name ex: !send 8:0:0 Nuro !token (generates a token to test if there's n

Jun 1, 2022

A chat logs online saver for discord bots to save messages history & cleared messages online

A chat logs online saver for discord bots to save messages history & cleared messages online

Chat Logs NPM package that saves messages online to view it later Useful for bots where users can save messages history & cleared messages online Supp

Dec 28, 2022

A base for developing Discord.js bots, written in TypeScript.

A base for developing Discord.js bots, written in TypeScript.

Nyx is a Discord bot template written in Typescript, supporting most of Discord.js' features alongside tools useful for bot development. 🇪🇸 README e

Dec 15, 2022

🤖 Makes it easy to create bots on discord through a simple command handler

🤖 Makes it easy to create bots on discord through a simple command handler

MyBotHelper.JS 📚 About facilitates the creation of bots via discord.js, the repository already has a main script that automatically synchronizes and

Dec 31, 2022

OBL is a free, libre and open source botlist for Discord, Revolt, Telegram and Guilded. No nfts,no web3,no daos. only bots lol

OBL (aka OpenBotList) Obl is a free,libre and open source botlist for Discord, Revolt, Telegram and Guilded that has free bananas ( Revolt, Telegram a

Sep 26, 2022

A Full-Featured Modern Dashboard Template for Discord Bots

A Full-Featured Modern Dashboard Template for Discord Bots

D-Dash: Discord Bot Dashboard A Full-Featured Dashboard Template for Discord Bots You can modify config/config.js to edit configuration without touchi

Jan 8, 2023

A Very Good Anti Nuke Bot that is better then those "premium" discord bots.

A Very Good Anti Nuke Bot that is better then those

AntiNuke AntiNuke Bot What is AntiNuke? A Open Source Discord Anti Nuke Bot to stop Raids, Nuking, and Mass Dms. ONLY THE RELEASE VERSION WORKS AT THE

Dec 29, 2022
Owner
Xaro
i do things. they work. sometimes. discord: Xaro#2775
Xaro
Multiplies a number by zero. Useful for when you need to multiply a number by zero

multiply-by-zero Multiplies a number by zero. Useful for when you need to multiply a number by zero Please consider checking out the links of this pro

Dheirya Tyagi 2 Jul 3, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Might be mineral fish site in future, idk. Currently just a fish list. Made with Svelte

Might be mineral fish site in future, idk. Currently just a fish list. Made with Svelte. Built version (used at mineralfish.github.io) at the build branch. Build steps and original README below.

Mineral Fish 3 Nov 3, 2022
Sachit Yadav 6 Nov 3, 2022
Yet another eslint blame (might) with better adaptability

yet-another-eslint-blame Yet another eslint blame (might) with better adaptability. The input is eslint's output with json format (You can see it here

快手“探索组”前端 5 Mar 7, 2022
injects Chromium extension into packaged electron apps. highly experimental. might work.

Electron extension injector injects Chromium extension into packaged electron apps. highly experimental. might work. use Alt+Shift+E to access extensi

Cynthia 6 Sep 2, 2022
A fixed-width file format toolset with streaming support and flexible options.

fixed-width A fixed-width file format toolset with streaming support and flexible options. Features Flexible: lot of options Zero dependencies: small

Evologi Srl 6 Jul 14, 2022