2024-08-03 02:09:39 +02:00
2024-06-23 23:04:53 +02:00
2024-06-24 02:37:39 +02:00
2024-06-24 02:37:39 +02:00
2024-06-23 23:04:53 +02:00
2024-06-23 23:04:53 +02:00
2024-06-23 23:04:53 +02:00
2024-08-03 02:08:02 +02:00
2024-08-03 02:09:39 +02:00
2024-08-03 02:08:02 +02:00
2024-06-23 23:04:53 +02:00

@alekswilc/ray

Lightweight & fast ray integration library written in typescript

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

Install

npm config set @alekswilc:registry=https://git.alekswilc.dev/api/packages/alekswilc/npm/
npm i @alekswilc/ray

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

Description
No description provided
Readme 126 KiB
Languages
TypeScript 84.6%
JavaScript 15.4%