@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
ALEKSRAY_URI
(default: http://localhost:23517/)ALEKSRAY_DISABLED
(default: null)
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
- Permafrost Development (node-ray under The MIT License)
Description
Languages
TypeScript
84.6%
JavaScript
15.4%