@aoitelegram/util
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@aoitelegram/util

NPM Version NPM Downloads License

A utility library for the aoitelegram project.

Installation

To use @aoitelegram/util in your project, you can install it via npm:

npm install @aoitelegram/util

Usage

// Esm/TypeScript
import { Logger } from "@aoitelegram/util";
// CommonJS
const { Logger } = require("@aoitelegram/util");

Logger.info("This is an info message");
Logger.warn("This is a warning message");
Logger.error("This is an error message");

Logger.custom({
  title: {
    text: "[ AoiClient ]:",
    color: "red",
    bold: true,
  },
  args: [
    {
      text: "Initialized on",
      color: "yellow",
      bold: true,
    },
    {
      text: "aoitelegram",
      color: "cyan",
      bold: true,
    },
    {
      text: `v${version}`,
      color: "blue",
      bold: true,
    },
    {
      text: "|",
      color: "yellow",
      bold: true,
    },
    {
      text: username,
      color: "green",
      bold: true,
    },
    {
      text: "|",
      color: "yellow",
      bold: true,
    },
    {
      text: "Sempai Development",
      color: "cyan",
      bold: true,
    },
  ],
});
// Esm/TypeScript
import { ConditionChecker, getObjectKey } from "@aoitelegram/util";
// CommonJS
const { ConditionChecker, getObjectKey } = require("@aoitelegram/util");

console.log(ConditionChecker.checkCondition("1==1")); // true
console.log(ConditionChecker.checkCondition("1!=1")); // false
console.log(
  ConditionChecker.checkCondition("{key:3, key2: 3}=={key2:3, key:3}"),
); // true

const newObj = { key: { key2: true } };
console.log(getObjectKey(newObj, "key")); // { key2: true }
console.log(getObjectKey(newObj, "key.key2")); // true

Documentation

For detailed documentation and usage instructions, please refer to the aoitelegram Wiki.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please create a GitHub issue or submit a pull request. Additionally, feel free to reach out to me on Telegram via my group AoiTelegram or on Discord using my username sempaika_chess.

Package Sidebar

Install

npm i @aoitelegram/util

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

38.1 kB

Total Files

17

Last publish

Collaborators

  • crazy-sempai07