open-index/open-npm huggingface dataset:
npm package: @frubana/adonis-kafka
Description: Kafka addon for AdonisJs
Author: @frubana
Latest version: 0.1.10

# Kafka Adonis Provider

## Setup

Add kafka when your app start.

```js
// server.js

new Ignitor(fold)
  .appRoot(__dirname)
  // Only add the next line
  .preLoad("start/kafka")
  .fireHttpServer()
  .catch(console.error);
```

Make sure to register the provider and make all of the following necessary changes inside the `start/app.js` file!

```js
// Add the kafka provider
const providers = [
  // ...
  "@frubana/adonis-kafka/providers/Provider"
];
```

## Config

Please update configuration before use. The configuration file is `config/kafka.js`.

## Adding topics

```js
// start/kafka.js

const Kafka = use("Kafka");

// Callback function
Kafka.on("topic_name", (data, commit) => {
  commit();
});

// Multiples topics with one controller.

Kafka.on("topic_name_1,topic_name_2,topic_name_3", (data, commit) => {
  commit();
});


// Controller function
Kafka.on("topic_name", "TestController.index");
```

## Define your controller

```js
// app/Controllers/Kafka/TestController.js

/** @type {import('@adonisjs/framework/src/Logger')} */
const Logger = use("Logger");

class TestController {
  index(data, commit) {
    Logger.info("kafka data", data);

    commit();
  }
}

module.exports = TestController;
```

## Produce events

```js
// app/Controllers/Http/TestController.js

const Kafka = use("Kafka");

class TestController {
  somefunction() {
    // data is a json object

    const data = {};
    Kafka.send("topicname", data);
  }
}
```
npm package: @frubana/adonis-newrelic
Description: NewRelic addon for AdonisJs
Author: @frubana
Latest version: 0.0.5

# Registering provider

## Setup

Add new relic provider in the top of providers list.

```js
// app/start.js

const providers = [
  `@frubana/adonis-newrelic/providers/Provider`
  // ...
];
```

In the main directory add `newrelic.js` and copy

```js
/** @type {import('@adonisjs/framework/src/Env')} */
const Env = use("Env");

/**
 * New Relic agent configuration.
 *
 * See lib/config/default.js in the agent distribution for a more complete
 * description of configuration variables and their potential values.
 */
exports.config = {
  /**
   * Array of application names.
   */
  app_name: [Env.get("APP_NAME")],
  /**
   * Your New Relic license key.
   */
  license_key: Env.get("NEW_RELIC"),

  logging: {
    /**
     * Level at which to log. 'trace' is most useful to New Relic when diagnosing
     * issues with the agent, 'info' and higher will impose the least overhead on
     * production applications.
     */
    level: "info"
  },
  /**
   * When true, all request headers except for those listed in attributes.exclude
   * will be captured for all traces, unless otherwise specified in a destination's
   * attributes include/exclude lists.
   */
  allow_all_headers: true,

  attributes: {
    /**
     * Prefix of attributes to exclude from all destinations. Allows * as wildcard
     * at end.
     *
     * NOTE: If excluding headers, they must be in camelCase form to be filtered.
     *
     * @env NEW_RELIC_ATTRIBUTES_EXCLUDE
     */
    exclude: [
      "request.headers.cookie",
      "request.headers.authorization",
      "request.headers.proxyAuthorization",
      "request.headers.setCookie*",
      "request.headers.x*",
      "response.headers.cookie",
      "response.headers.authorization",
      "response.headers.proxyAuthorization",
      "response.headers.setCookie*",
      "response.headers.x*"
    ]
  }
};
```

In your `.env` file add this variable and paste your new relic key

```env
NEW_RELIC=
```
npm package: @frubana/adonis-sqs
Description: SQS addon for AdonisJs
Author: @frubana
Latest version: 0.0.9

# SQS Adonis Provider

**This is a WIP**

## Setup

Make sure to register the provider and make all of the following necessary changes inside the `start/app.js` file!

```js
// Add the sqs provider
const providers = [
  // ...
  "@frubana/adonis-sqs/providers/Provider"
];
```

## Config

Please update configuration before use. The configuration file is `config/queues.js`.

## Define your Job

```js
// app/Jobs/Test.js

const Logger = use("Logger");

class Test {
  async handler(data, message, done) {
    Logger.info("Queue started Test");

    done(true);
  }
}

module.exports = Test;
```