open-index/open-npm huggingface dataset:
npm package: @mailbots/logger
Description: Internal MailBots tool for aggregating LogDNA and Datadog into a nice, unified logger
Author: Reilly Sweetland
Latest version: 0.5.0

# MailBots Logger

A custom logger for the monitoring tools we use internally at
FollowUpThen and MailBots: – Datadog and LogDNA.

LogDNA gets logs for debugging. The logger turns log events into
datadog metrics, allowing us to view frequency of log events in
dashboards, alerts and enable anomoly detection, etc.

## Usage

```javascript
const Logger = require("@mailbots/logger");
const logger = new Logger({
  logDnaKey: process.env.LOGDNA_KEY,
  logDnaHost: process.env.LOGDNA_HOSTNAME,
  logDnaApp: process.env.LOGDNA_APPNAME,
  ddAppKey: process.env.DATADOG_APP_KEY,
  ddApiKey: process.env.DATADOG_API_KEY,
  ddMetricsPrefix: process.env.DATADOG_METRICS_PREFIX || "", // to keep microservice metrics organized
  logToConsole: process.env.LOG_TO_CONSOLE // log to console.log. Pass "short" not pass extra data
});

// A simple log message
logger.log("a simple log message");
```

## Set Logging Context

Set context from webhook. Every subsequent log event in that the request shares
this context, allowing for searching by userid or session-id.

```javascript
logger.setContextFromWebhook(webhook);
```

You can also set logging context from the AWS Lambda context object.

```javascript
logger.setLambdaContext(context);
```

## Caution: Data Types

When passing debug data in the `data` param, data types need to remain
consistent (LogDNA requirement for their indexing feature).
As a convention, always imply the datatype of the debug var
in the key name.

```javascript
logger.log("a log message", { level: "info", data: { debug_str: "data" } });
```

## Debugging

Run tests with `DEBUG=@mailbots/logger` to tests our parts and datadog.
Runt tests with `NODE_DEBUG=logdna` to see logdna output.

Here's an .env template to copy / paste:

```
LOGDNA_KEY=
LOGDNA_HOSTNAME=
LOGDNA_APPNAME=
NODE_ENV=

DATADOG_API_KEY=
DATADOG_APP_KEY=
DATADOG_METRICS_PREFIX=
```

## Available logging services
Besides logging the message to the console, the library also sends it to our third-party logging services:
- LogDna
- DataDog

A log message can opt out of individual services by passing a boolean param to the options object:
```javascript
logger.log("a log message", { datadog: false, logdna: false });
```
npm package: @mailbutler/axios-chrome-messaging-adapter
Description: Axios adapter using Chrome Extensions Messaging to perform requests from the background page.
Author: dzetah
Latest version: 0.5.2

# axios-chrome-messaging-adapter

Axios adapter to pass the requests to a Chrome Extension background script. Useful to avoid CORB in content scripts.

More informations about CORB [here](https://www.chromestatus.com/feature/5629709824032768) and [here](https://www.chromium.org/Home/chromium-security/extension-content-script-fetches).

## Getting Started

### Prerequisites

This axios adapter is **only intended to be used in Chrome extensions**, it simply forwards axios requests to the background script, using the `chrome.runtime.sendMessage(...)` API.

### Installation

#### With npm (or yarn)

```
$ npm install --save axios-chrome-messaging-adapter
$ # Or
$ yarn add axios-chrome-messaging-adapter
```

#### With a CDN

Axios must be available as a global object so you'll need to import it from a CDN too, we use **unpkg** here as an example.

```html
<script src="https://unpkg.com/axios@0.18.0/dist/axios.min.js"></script>
<script src="https://unpkg.com/axios-chrome-messaging-adapter@0.3.1/dist/axios-chrome-messaging-adapter.min.js"></script>
```

### Quick start

If you are using a bundler, like webpack or rollup:, you'll just need to **`require`** the lib. If you are using a CDN, the lib will be available under **`window.axiosChromeMessagingAdapter`**.

In your **background** script:

```javascript
import axios from 'axios';
import { registerMessageHandler } from 'axios-chrome-messaging-adapter';

// register the adapter message hanlder
registerMessageHandler();
```

In your **content** script:

```javascript
import axios from 'axios'
import { adapter } from 'axios-chrome-messaging-adapter'

// tell axios to use the adapter for this request
const axiosInstance = axios.create({
  adapter,
  ... // the rest of your configuration :)
})
```

## Known limitations

The adapter is currently incompatible with the following axios parameters:

- paramsSerializer
- onUploadProgress
- onDownloadProgress
- cancelToken

This limitation is due to the fact that only scalar values can pass through the chrome messaging API, making these callbacks functions unavailable for the moment.

If one of these options is used, it will be ignored and the content script will emit a warning.

## Development

Clone the project to the directory and install dependencies

```bash
$ git clone https://github.com/dzetah/axios-chrome-messaging-adapter
$ cd axios-chrome-messaging-adapter
$ yarn # or npm install
$ npm i --no-save axios # install axios peer dependency
```

Start typescript compilation in watch mode

```bash
$ npm run watch
```
npm package: @mailbutler/axios-fetch-adapter
Description: Fetch adapter for axios
Author: nta.toan@gmail.com
Latest version: 0.2.2

# Why

I'm going to adopt PWA to my web applications and those web apps are heavily using Axios with the default XMLHTTPRequest adapter. Hence, I have to switch to Fetch adapter; However, Axios doesn't have an adapter for fetch API for now. So I write one to use while waiting for an offical one from Axios.

# Installation and Usage

You can install the adapter directly from this repository URL or feel free to copy its source code to your project.

```
npm install axios
npm install @mailbutler/axios-fetch-adapter
```

There are two ways to use it:

1.  Create a new instance of Axios and pass this adapter in configuration

```
const instance = axios.create({
  baseURL: 'https://some-domain.com/api/',
  timeout: 1000,
  adapter: fetchAdapter
  ....
});
```

2.  Pass this adapter in each of request

```
axios.request({
  url: '/user',
  method: 'get',
  adapter: fetchAdapter
  ...
})
```

# Note

- Since, this adapter relies on fetch API so it won't work in Node environment
npm package: @mailbutler/dayjs-plugins
Description: Mailbutler dayjs utility and formatting plugins.
Author: Stanyslas Bres
Latest version: 0.2.2

# @mailbutler/dayjs-plugins

A set of utility and formatting plugins for Dayjs.

## Getting Started

### Prerequisites

The plugins in this package depends on the following dayjs plugins:
- **calendar**
- **localizedFormat**

You also need to import the following locales before registering the plugin:
- **de**
- **en**
- **fr**

> You need to import those dependencies **before** you import the plugins from this package.

### Installation

#### With npm (or yarn)

```
$ npm install --save @mailbutler/dayjs-plugins
$ # Or
$ yarn add @mailbutler/dayjs-plugins
```

#### With a CDN

Dayjs must be available as a global object so you will need to import it from a CDN too, we use **unpkg** here as an example.

```html
<script src="https://unpkg.com/dayjs@1.8.15/dayjs.min.js"></script>
<script src="https://unpkg.com/@mailbutler/dayjs-plugins@0.1.0/dist/dayjs-plugin-mailbutler-calendar.min.js"></script>
```

### Quick start 

If you are using a bundler, like webpack or rollup you'll just need to **`require`** the lib.

If you are using a CDN, the lib will be available under **`window.dayjsPluginMailbutlerCalendar`**.

```javascript
const dayjs = require('dayjs')
const localizedFormat = require('dayjs/plugin/localizedFormat');
const calendar = require('dayjs/plugin/calendar');
const { relative, calendarLocalization } = require('@mailbutler/dayjs-plugins')

// import required translation files
require('dayjs/locale/de')
require('dayjs/locale/en')
require('dayjs/locale/fr')

// register required plugins
dayjs.extends(localizedFormat)
dayjs.extends(calendar)

// register the plugins
dayjs.extends(calendarLocalization)
dayjs.extends(relative)
```

### The `calendarLocalization` plugin

> Depends on `calendar` and `localizedFormat` plugins.

Adds localized formatting for the calendar for the folllowing languages:
- en
- de
- fr

When using `calendar` with one of these languages, the output string will be localized.

Example:

```js
const localized = dayjs('2019-05-01').calendar();
```

### The `relative` plugin

> Depends on the `calendarLocalization` plugin.

adds two new methods to the dayjs instance.

- `relative` allows the user to format the date relatively to another date.
- `relativeNow` allows the user to format the date relatively to the current date.

Example:

```js
// relative
dayjs('2018-12-12').relative(dayjs('2018-12-25'))
dayjs('2018-12-12').relativeNow()
```

## Development

Clone the project to the directory and install dependencies

```bash
$ git clone https://github.com/Mailbutler/dayjs-plugins
$ cd dayjs-plugins
$ yarn # or npm install
$ npm i --no-save dayjs # install dayjs peer dependency
```

Start bundling in watch mode

```bash
$ npm run watch
```