ray/readme.md
2024-06-23 23:04:53 +02:00

1.7 KiB

@alekswilc/ray

Lightweight & fast ray integration library written in typescript

  • Supports ESM and CommonJS
  • Provides standalone bundle
  • Supports node 16+
  • Simple usage

Performance

  • 3 requests took avg 28ms.
  • avg 2Mb memory usage on request

Env configuration

Methods

/* COLORS */
import { ray } from '@alekswilc/ray';
ray("Message").green();
ray("Message").orange();
ray("Message").red();
ray("Message").purple();
ray("Message").blue();
ray("Message").gray();
ray("Message").color('red');

/* LOGGER */
ray().log("Message")
ray().info("Message")
ray().debug("Message")
ray().warn("Message")
ray().error("Message")
ray().error(new Error("Message"))


/* FORMATS */
ray().label('TEST'); // set label
ray().separator(); // display separator
ray().raw({"test"}); // raw log
ray().json({"test"}); // display json
ray().pretty(["test"]) // display using pretty-format
ray().send("data") // alias to ray("data")
await ray().pause() // break point [ASYNC FUNCTION]


/* SET CUSTOM ORIGIN */
ray().customOrigin({ function_name: "test", file: "test.js", line_number: 1, hostname: "aleks-desktop" }).send("test")

/* CHAINING */
ray('test').color('red').label('test2') 

Used dependencies

License

The MIT License (MIT). Please see License File for more information.

Credits