open-index/open-npm huggingface dataset:
npm package: @moleculer/lab
Description: [![NPM version](https://badgen.net/npm/v/@moleculer/lab)](https://www.npmjs.com/package/@moleculer/lab) [![Moleculer](https://badgen.net/badge/Powered%20by/Moleculer/0e83cd)](https://moleculer.services)
Author: MoleculerJS
Latest version: 0.6.5

# Moleculer Laboratory - Agent Service

[![NPM version](https://badgen.net/npm/v/@moleculer/lab)](https://www.npmjs.com/package/@moleculer/lab)
[![Moleculer](https://badgen.net/badge/Powered%20by/Moleculer/0e83cd)](https://moleculer.services)

## Install

```bash
npm i @moleculer/lab --save
```

## Usage

### Laboratory Agent service
```js
// lab.service.js
const Laboratory = require("@moleculer/lab");

module.exports = {
    mixins: [Laboratory.AgentService],
    settings: {
        token: "<something secret text>", // or set process.env.LAB_TOKEN
        apiKey: "<your API key>" // or set process.env.LAB_APIKEY
    }
};
```
> The API key is sent to beta testers in e-mail.

Open the https://lab.moleculer.services and add a new project with the `http://localhost:3210` URL and use the given (or generated) token.

### Laboratory Metric Reporter
```js
// moleculer.config.js
const Laboratory = require("@moleculer/lab");

module.exports = {
    // ...
    metrics: {
        enabled: true,
        reporter: "Laboratory"
    },        
    // ...
}
```

### Laboratory Tracing Exporter
```js
// moleculer.config.js
const Laboratory = require("@moleculer/lab");

module.exports = {
    // ...
    tracing: {
        enabled: true,
        exporter: "Laboratory"
    },       
    // ...
}
```

### Laboratory Logger
```js
// moleculer.config.js
const Laboratory = require("@moleculer/lab");

module.exports = {
    // ...
	logger: [{
		type: "Console",
		options: { /*...*/ }
	}, "Laboratory"],    
    // ...
}
```

# Contact
Copyright (c) 2016-2025 MoleculerJS

[![@moleculerjs](https://img.shields.io/badge/github-moleculerjs-green.svg)](https://github.com/moleculerjs) [![@MoleculerJS](https://img.shields.io/badge/twitter-MoleculerJS-blue.svg)](https://twitter.com/MoleculerJS)