Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-ray

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ray

Debug NodeJS with Ray to fix problems faster

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.5K
increased by25.28%
Maintainers
1
Weekly downloads
 
Created
Source

node-ray

node-ray

node-ray

Debug your NodeJS code with Ray to fix problems faster

This package can be installed in any NodeJS application to send messages to the Ray app.

Installation

Install with npm:

npm install node-ray

or yarn:

yarn add node-ray

Usage

The majority of the API from the original PHP package is supported. See the api reference for more information.

// es module import:
import { ray } from 'node-ray';

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

ray(['several', 'arguments'], 'can', {be: provided});

ray().table(['one two', {a: 100, b: 200, c: 300}, [9, 8, 7]).blue();

ray().html('<em>large text</em>').large().green();

ray().image('https://placekitten.com/200/300');

ray().clearAll();

ray().disable(); // disable sending data to Ray at runtime
ray().xml('<one>11</one>'); // disabled, data not sent to Ray

Configuration

node-ray will search for ray.config.js. You should place this file in your project's root directory, similiar to the way ray.php is placed in the root directory when using spatie/ray.

This is optional and the package will use the default settings if no configuration file is found.

Example:

// ray.config.js

module.exports = {
    enable: true,
    host: 'localhost',
    port: 23517,
}

About

This package attempts to replicate the entire PHP API for Ray to provide a robust solution for debugging NodeJS projects.

How is this different from js-ray?

This is a more complete implementation written in typescript, and its primary use case is for NodeJS projects (the default builds won't work in a browser environment).

The codebase was translated to Typescript directly from the original PHP source code of spatie/ray.

As a result, node-ray supports the majority of features that exist in the original package; js-ray does not.

We did draw some inspiration for portions of the code from js-ray, however.

Development setup

  • npm install
  • npm run build:all
  • node build/test.js

Testing

node-ray uses Jest for unit tests. To run the test suite:

npm run test

To update the test snapshots:

npm run test -- -u


License

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

FAQs

Package last updated on 06 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc