Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .eslintignore

This file was deleted.

25 changes: 0 additions & 25 deletions .eslintrc.cjs

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: true
matrix:
node-version: [18, 20]
node-version: [22, 24]

steps:
- name: Checkout repository
Expand All @@ -29,7 +29,7 @@ jobs:
run: bun install

- name: Run the tests with coverage
run: bun run test
run: bun test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down
6 changes: 3 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
/coverage
.editorconfig
.eslintrc.js
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider removing obsolete ignore entries.

Since .eslintrc.cjs was removed in favor of eslint.config.js and biome.json was renamed to biome.jsonc, the ignore entries for .eslintrc.js (line 14) and biome.json (line 28) are now obsolete. While harmless, removing them would keep the file tidy.

Also applies to: 28-28

🤖 Prompt for AI Agents
In @.npmignore at line 14, Remove the obsolete ignore entries from .npmignore:
delete the lines containing ".eslintrc.js" and "biome.json" (these were left
over after moving to eslint.config.js and renaming biome.json to biome.jsonc) so
the .npmignore only contains current, relevant ignore patterns; verify no other
stale config filenames remain in the file.

eslint.config.js
.prettierignore
.prettierrc
prettier.config.js
jest.config.js
package-lock.json
bun.lock
SECURITY.md
tsconfig.json
*.sh
_*.txt
*.ignore
rollup.*.js
.eslintignore
biome.json
prettier.config.cjs
.eslintrc.cjs
biome.jsonc
vite.config.js
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

#### [v3.0.0](https://github.com/permafrost-dev/node-ray/compare/v2.1.2...v3.0.0)

> 31 January 2026

- BREAKING: ESM-only packages moving forward; removed CommonJS builds.
- BREAKING: Node.js >= 20.19 required
- Upgrade all outdated dependencies
- Upgrade ESLint 9 + TypeScript ESLint 8, Prettier 3.8, Vite 7, Vitest 4, and TypeScript 5.9
- Docs updated for ESM-only usage and configuration

#### [v2.1.2](https://github.com/permafrost-dev/node-ray/compare/v2.1.1...v2.1.2)

- update npmignore [`8517423`](https://github.com/permafrost-dev/node-ray/commit/85174235d68dc0d9df260ee39d092d941fc6bd26)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The MIT License (MIT)
Copyright © 2021 Permafrost Development
Copyright © 2026 Permafrost Software, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
139 changes: 69 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</p>

# node-ray

### The official Node/JS & TypeScript integration for Ray - Understand and fix bugs faster.

The package can be installed in any NodeJS, ES6+, or TypeScript application to send data to the [Ray app](https://myray.app).
Expand All @@ -41,13 +42,18 @@ or bun:
bun add node-ray
```

## Requirements

- Node.js >= 20.19
- ESM-only (CommonJS is no longer supported; use v2.x for `require` support)

## Available environments

`node-ray` offers several options to allow you to use it in either NodeJS, Web-based TypeScript or Javascript projects, and browser environments.
`node-ray` offers several options to allow you to use it in either NodeJS, Web-based TypeScript or JavaScript projects, and browser environments.

>If you're using NextJs/React, take a look at [permafrost-dev/react-ray](https://github.com/permafrost-dev/react-ray).
>
>If you're using Vue, check out [permafrost-dev/vue-ray](https://github.com/permafrost-dev/vue-ray).
> If you're using NextJs/React, take a look at [permafrost-dev/react-ray](https://github.com/permafrost-dev/react-ray).
>
> If you're using Vue, check out [permafrost-dev/vue-ray](https://github.com/permafrost-dev/vue-ray).

Comment on lines +52 to 57
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove trailing space in the blockquote to satisfy markdownlint.

📝 Suggested diff
-> 
+>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
`node-ray` offers several options to allow you to use it in either NodeJS, Web-based TypeScript or JavaScript projects, and browser environments.
>If you're using NextJs/React, take a look at [permafrost-dev/react-ray](https://github.com/permafrost-dev/react-ray).
>
>If you're using Vue, check out [permafrost-dev/vue-ray](https://github.com/permafrost-dev/vue-ray).
> If you're using NextJs/React, take a look at [permafrost-dev/react-ray](https://github.com/permafrost-dev/react-ray).
>
> If you're using Vue, check out [permafrost-dev/vue-ray](https://github.com/permafrost-dev/vue-ray).
`node-ray` offers several options to allow you to use it in either NodeJS, Web-based TypeScript or JavaScript projects, and browser environments.
> If you're using NextJs/React, take a look at [permafrost-dev/react-ray](https://github.com/permafrost-dev/react-ray).
>
> If you're using Vue, check out [permafrost-dev/vue-ray](https://github.com/permafrost-dev/vue-ray).
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

[warning] 55-55: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)

🤖 Prompt for AI Agents
In `@README.md` around lines 52 - 57, Remove the trailing space at the end of the
blockquote line(s) that reference permafrost-dev/react-ray and
permafrost-dev/vue-ray (the lines beginning with ">" in the README blockquote)
so the blockquote does not have trailing whitespace; edit the two blockquote
lines to end immediately after the URL text with no extra space.

### NodeJS

Expand All @@ -56,20 +62,16 @@ When using in a NodeJS environment (the default), import the package as you woul
```js
// es module import:
import { ray } from 'node-ray';

// commonjs import:
const ray = require('node-ray').ray;
```

`node-ray` is ESM-only. CommonJS `require` is not supported.

### Browser bundle

When bundling scripts for use in a Browser environment _(i.e., using webpack or vite)_, import the `/web` export:

```js
import { ray } from 'node-ray/web';

// or a commonjs import:
const { ray } = require('node-ray/web');
```

### Browser standalone
Expand Down Expand Up @@ -104,7 +106,7 @@ As of version `2.0.0`, you no longer need to manually initialize the global `ray
To use `node-ray` with Laravel Mix, include the following in `resources/js/bootstrap.js`:

```js
const { ray } = require('node-ray/web');
import { ray } from 'node-ray/web';

window.ray = ray;
```
Expand All @@ -130,9 +132,6 @@ Most of the API from the [original PHP package](https://github.com/spatie/ray) i
```js
// es module import:
import { ray } from 'node-ray';

// commonjs import:
const { ray } = require('node-ray');
```

To modify the host or port:
Expand Down Expand Up @@ -175,7 +174,7 @@ ray().xml('<one>11</one>'); // previous call disabled sending data, XML not sent

_Note: This section only applies when using `node-ray` in the NodeJS environment, NOT a browser environment._

`node-ray` will search for `ray.config.js`, which should be in the project's root directory.
`node-ray` will search for `ray.config.js`, which should be in the project's root directory. The config file is ESM and should use `export default`.

Using a configuration file is optional, and the package will use the default settings if no configuration file is specified.

Expand All @@ -184,7 +183,7 @@ _Example:_
```js
// ray.config.js

module.exports = {
export default {
enable: true,
host: 'localhost',
port: 23517,
Expand Down Expand Up @@ -279,60 +278,60 @@ See [using the package](docs/usage.md).

## Reference

| Call | Description |
| --- | --- |
| `ray(variable)` | Display a string, array or object |
| `ray(var1, var2, …)` | Ray accepts multiple arguments |
| `ray().blue()` | Output in color. Use `green`, `orange`, `red`, `blue`,`purple` or `gray` |
| `ray().caller()` | **Asynchronous.** Show the calling class and method |
| `ray().chain(callback)` | Chain multiple Ray payloads and send them all at once. `callback: (ray: Ray) => void` |
| `ray().clearScreen()` | Clear current screen |
| `ray().clearAll()` | Clear current and all previous screens |
| `ray().className(obj)` | Display the classname for an object |
| `ray().confetti()` | Display Confetti in Ray |
| `ray().count(name)` | Count how many times a piece of code is called, with optional name |
| `ray().date(date, format)` | Display a formatted date, the timezone, and its timestamp |
| `ray().die()` | Halt code execution - NodeJS only |
| `ray().disable()` | Disable sending stuff to Ray |
| `ray().disabled()` | Check if Ray is disabled |
| `ray().enable()` | Enable sending stuff to Ray |
| `ray().enabled()` | Check if Ray is enabled |
| `ray().error(err)` | Display information about an Error/Exception |
| `ray().event(name, data)` | Display information about an event with optional data |
| `ray().exception(err)` | **Asynchronous.** Display extended information and stack trace for an Error/Exception |
| `ray().file(filename)` | **NodeJS only.** Display contents of a file |
| `ray().hide()` | Display something in Ray and make it collapse immediately |
| `ray().hideApp()` | Programmatically hide the Ray app window |
| `ray().html(string)` | Send HTML to Ray |
| `ray().htmlMarkup(string)` | Display syntax-highlighted HTML code in Ray |
| `ray().if(true, callback)` | Conditionally show things based on a truthy value or callable, optionally calling the callback with a `ray` argument |
| `ray().image(url)` | Display an image in Ray |
| `ray().interceptor()` | Access ConsoleInterceptor; call `.enable()` to show `console.log()` calls in Ray |
| `ray().json([…])` | Send JSON to Ray |
| `ray().label(string)` | Add a text label to the payload |
| `ray().limit(N)` | **Asynchronous.** Limit the number of payloads that can be sent to Ray to N; used for debugging within loops |
| `ray().macro(name, callable)` | Add a custom method to the Ray class. make sure not to use an arrow function if returning `this` |
| `ray().measure(callable)` | Measure the performance of a callback function |
| `ray().measure()` | Begin measuring the overall time and elapsed time since previous `measure()` call |
| `ray().newScreen()` | Start a new screen |
| `ray().newScreen('title')` | Start a new named screen |
| `ray().nodeinfo()` | **NodeJS only.** Display statistics about node, such as the v8 version and memory usage |
| `ray().notify(message)` | Display a notification |
| `ray().once(arg1, …)` | **Asynchronous.** Only send a payload once when in a loop |
| `ray().pass(variable)` | Display something in Ray and return the value instead of a Ray instance |
| `ray().pause()` | Pause code execution within your code; must be called using `await` |
| `ray().projectName(name)` | Change the active project name |
| `ray().remove()` | Remove an item from Ray |
| `ray().screenColor(color)` | Changes the screen color to the specified color |
| `ray().separator()` | Display a separator |
| `ray().showApp()` | Programmatically show the Ray app window |
| `ray().small()` | Output text smaller or bigger. Use `large` or `small`|
| `ray().stopTime(name)` | Removes a named stopwatch if specified, otherwise removes all stopwatches |
| `ray().table(…)` | Display an array or an object formatted as a table; Objects and arrays are pretty-printed |
| `ray().text(string)` | Display raw text in Ray while preserving whitespace formatting |
| `ray().toJson(variable)` | Convert a variable using `JSON.stringify()` and display the result |
| `ray().trace()` | Display a stack trace |
| `ray().xml(string)` | Send XML to Ray |
| Call | Description |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `ray(variable)` | Display a string, array or object |
| `ray(var1, var2, …)` | Ray accepts multiple arguments |
| `ray().blue()` | Output in color. Use `green`, `orange`, `red`, `blue`,`purple` or `gray` |
| `ray().caller()` | **Asynchronous.** Show the calling class and method |
| `ray().chain(callback)` | Chain multiple Ray payloads and send them all at once. `callback: (ray: Ray) => void` |
| `ray().clearScreen()` | Clear current screen |
| `ray().clearAll()` | Clear current and all previous screens |
| `ray().className(obj)` | Display the classname for an object |
| `ray().confetti()` | Display Confetti in Ray |
| `ray().count(name)` | Count how many times a piece of code is called, with optional name |
| `ray().date(date, format)` | Display a formatted date, the timezone, and its timestamp |
| `ray().die()` | Halt code execution - NodeJS only |
| `ray().disable()` | Disable sending stuff to Ray |
| `ray().disabled()` | Check if Ray is disabled |
| `ray().enable()` | Enable sending stuff to Ray |
| `ray().enabled()` | Check if Ray is enabled |
| `ray().error(err)` | Display information about an Error/Exception |
| `ray().event(name, data)` | Display information about an event with optional data |
| `ray().exception(err)` | **Asynchronous.** Display extended information and stack trace for an Error/Exception |
| `ray().file(filename)` | **NodeJS only.** Display contents of a file |
| `ray().hide()` | Display something in Ray and make it collapse immediately |
| `ray().hideApp()` | Programmatically hide the Ray app window |
| `ray().html(string)` | Send HTML to Ray |
| `ray().htmlMarkup(string)` | Display syntax-highlighted HTML code in Ray |
| `ray().if(true, callback)` | Conditionally show things based on a truthy value or callable, optionally calling the callback with a `ray` argument |
| `ray().image(url)` | Display an image in Ray |
| `ray().interceptor()` | Access ConsoleInterceptor; call `.enable()` to show `console.log()` calls in Ray |
| `ray().json([…])` | Send JSON to Ray |
| `ray().label(string)` | Add a text label to the payload |
| `ray().limit(N)` | **Asynchronous.** Limit the number of payloads that can be sent to Ray to N; used for debugging within loops |
| `ray().macro(name, callable)` | Add a custom method to the Ray class. make sure not to use an arrow function if returning `this` |
| `ray().measure(callable)` | Measure the performance of a callback function |
| `ray().measure()` | Begin measuring the overall time and elapsed time since previous `measure()` call |
| `ray().newScreen()` | Start a new screen |
| `ray().newScreen('title')` | Start a new named screen |
| `ray().nodeinfo()` | **NodeJS only.** Display statistics about node, such as the v8 version and memory usage |
| `ray().notify(message)` | Display a notification |
| `ray().once(arg1, …)` | **Asynchronous.** Only send a payload once when in a loop |
| `ray().pass(variable)` | Display something in Ray and return the value instead of a Ray instance |
| `ray().pause()` | Pause code execution within your code; must be called using `await` |
| `ray().projectName(name)` | Change the active project name |
| `ray().remove()` | Remove an item from Ray |
| `ray().screenColor(color)` | Changes the screen color to the specified color |
| `ray().separator()` | Display a separator |
| `ray().showApp()` | Programmatically show the Ray app window |
| `ray().small()` | Output text smaller or bigger. Use `large` or `small` |
| `ray().stopTime(name)` | Removes a named stopwatch if specified, otherwise removes all stopwatches |
| `ray().table(…)` | Display an array or an object formatted as a table; Objects and arrays are pretty-printed |
| `ray().text(string)` | Display raw text in Ray while preserving whitespace formatting |
| `ray().toJson(variable)` | Convert a variable using `JSON.stringify()` and display the result |
| `ray().trace()` | Display a stack trace |
| `ray().xml(string)` | Send XML to Ray |

## FAQ

Expand Down
Loading
Loading