1.31.0 • Published 9 days ago

lightrun v1.31.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
9 days ago

Lightrun for Node.js

Lightrun is a developer-native observabity platform. It's a way to add logs, inspect the state of the current execution (in a familiar, debugger-like view), and extract any type of code-level metric on the fly - without redeploying, restarting or even stopping the running application.

Check out our docs to learn more.

Getting Started

To get started with Lightrun you'll need three things:

  1. A Lightrun Account - you can get one here.
  2. A Lightrun Plugin - you'll have instructions to download it once you create an account, but you can also check them out here.
  3. A Lightrun Agent - which is this very NPM package! It's the thing that actually does the magic.

Once you've signed up for an account and downloaded the plugin, you can install the agent in your application.

Installing the Lightrun Agent

In order to install the Lightrun Node Agent please follow these steps:

  1. In your project's folder, install the node agent by running npm install lightrun.

  2. a. For regular Node.js applications - Require Lightrun at the start of your your application file (i.e. index.js or app.js):

    require('lightrun').start({
        lightrunSecret: '<COMPANY-SECRET>',
    });

    b. For TypeScript applications - Import Lightrun at the start of your your application file (i.e. index.ts or app.ts) and then start it:

    import * as lightrun from 'lightrun';
    
    lightrun.start({
        lightrunSecret: '<COMPANY-SECRET>',
    });

    You will have a <COMPANY-SECRET> auto-generated for you during the onbaording process, right after signing up for an account.

    Important Note - Sourcemap Files

    Lightrun for TypeScript needs to have sourcemap files available to it in order to work properly. Please make sure to set sourceMap to true when compiling your TypeScript code.

  3. Run the application as you normally would.

You should now see the application's agent popping up in the Lightrun Plugin's sidebar - you can now add logs, snapshots and metrics to your application.

Providing Credentials Via Environment Variables

You can optionally choose to provide the <COMPANY-SECRET> via environment variables to the Node process. To do so, follow these steps after installing the agent (note that this does not work on Windows):

  1. Import Lightrun at the start of the file:
require('lightrun').start();
  1. Run the application with the environment variables provided before the node command:
LIGHTRUN_SECRET=<COMPANY_SECRET> node index.js
1.31.0

9 days ago

1.30.0

19 days ago

1.29.0

1 month ago

1.28.0

2 months ago

1.27.0

2 months ago

1.26.0

2 months ago

1.25.0

3 months ago

1.24.0

4 months ago

1.23.0

4 months ago

1.22.0

4 months ago

1.21.0

5 months ago

1.20.0

5 months ago

1.15.0

8 months ago

1.19.0

6 months ago

1.18.0

6 months ago

1.17.0

7 months ago

1.16.0

7 months ago

1.14.0

9 months ago

1.13.0

10 months ago

1.12.0

12 months ago

1.9.3

11 months ago

1.9.2

11 months ago

1.9.1

1 year ago

1.11.0

1 year ago

1.10.0

1 year ago

1.9.0

1 year ago

1.8.1

1 year ago

1.8.0

1 year ago

1.7.0

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago

1.5.1

2 years ago

1.4.2

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.2.4

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.3

2 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

0.0.0

3 years ago