open-index/open-npm huggingface dataset:
npm package: @juntoz/azure-service-bus-sender
Description: Quick logger that enables the function to log to the default logger (console) and also to papertrail
Author: Juntoz.com
Latest version: 2.0.3

# azure-service-bus-sender
Wrapper for Azure Service Bus to send messages to topics and queues.

This library was created to provide a singleton for bus client, topic client and sender to be able to reuse them which is the recommended pattern (expensive objects).

# Install
```
npm install @juntoz/azure-service-bus-sender
```

# Use it
```
const ASBWrapper = require('@juntoz/azure-service-bus-sender');

// create a singleton, this is important because asb is a expensive object
var asb = new ASBWrapper();

async function main_azfunc() {
    // NOTE: the bus name is important because it is the key to cache the clients.
    var busName;
    var busConnectionString, busTopicName, busQueueName;

    // create or reuse the topic sender
    var ts = asb.createTopicSender(busName, busConnectionString, busTopicName);

    // send the message
    await ts.send(myMsg);

    // create or reuse the queue sender
    var qs = asb.createQueueSender(busName, busConnectionString, busQueueName);

    // send the message
    await qs.send(myMsg);
}

module.exports = main_azfunc;
```

# Cleanup
The class also has a cleanup method which can be called to close the bus client connections. In Azure Functions, this is not really needed to be called, however, if this is used outside AzF, then you should call it at the end of the application.
npm package: @juntoz/koa-health-probe
Description: Health probe for Koa
Author: Kat Lim Ruiz
Latest version: 1.0.7

# koa-health-probe
Health probe for Koa that uses http://github.com/juntoz/koa-last-request to provide a bit meaningful info

## Usage
```
const Koa = require('koa');
const KoaRouter = require('koa-router');
const setupKoaHealthProbe = require('koa-health-probe');

// create koa app
var app = new Koa();
var router = new KoaRouter();

// setup the probe
setupKoaHealthProbe(router, youroptions);

// setup routes on the app
app.use(router.routes()).use(router.allowedMethods());

```

## Options

```
var options = {
    // route path to use, default is /tools/probe
    path: string,
    // function to customize the object returned for every probe tryout
    onRequest: function
}
```

## Optional dependency on http://github.com/juntoz/koa-last-request

The package `koa-last-request` is used to provide the last timestamp the koa app has processed something (you can configure it to ignore certain paths, for example, this probe :)).
If the package is not present, then the timestamp is not generated.

When you setup the koa-last-request, do not forget to add this probe's path to be ignored, this way only "real" requests get logged.

```
// require
const lastreq = require("koa-last-request");

// setup
var koa = new Koa();
koa.use(lastreq({ pathsToIgnore: ['tools/probe'] });
```
npm package: @juntoz/koa-last-request
Description: Stores information about the last request of a Koa application
Author: Kat Lim Ruiz
Latest version: 1.0.3

# koa-last-request
Stores information about the last request of a Koa application.

## Intro
The idea behind this library is to get a hold of generic information about the last request that the application processed.

Although it is a simple concept and it may be used of other purposes, my intended usage is to be able to tell whether the application is still alive or not.

So if you use it paired with a health probe endpoint you can tell when was the last time the application processed something.

## Options
```
options = {
    // array of partial paths that need to be ignored. The match will be made using String.indexOf >= 0.
    pathsToIgnore: [],
    // optional event to customize further the info to be stored
    onStamp: (ctx, lastRequestInfo) => { }
}
```

## Usage
```
// require
const lastreq = require("koa-last-request");

// setup
var koa = new Koa();
koa.use(lastreq({ /* my options */ });

// use it
console.log(koa.lastRequest);
```
## Feedback
Feedback and contributions are more than welcome

## TODO
Tests
Eslint
npm package: @juntoz/koa-package-info
Description: Plugin for Koa to add a route that will return the package name and version, used to know which version is running
Author: Juntoz.com
Latest version: 1.0.3

# koa-package-info
Plugin for Koa to add a route that will return the package name and version, used to know which version is running

# Usage
```
const Koa = require('koa');
const pkinfo = require('koa-package-info');

// create koa app
var app = new Koa();

// setup the route
pkinfo(app, youroptions);
```

# Options
```
var options = {
    // route path to use, default is /tools/version
    path: '/tools/version',
    // package.json location relative to the main file (index.js), so we can use require.main.require to load it
    pathToPackageJson: './package.json'
}
```
## Possible breach?
I don't think so, an application name and version is information that is public domain (kind of looking at excel.exe properties).

So if you modify this project to provide more information, consider this premise before exposing other fields.
npm package: @juntoz/koa-pino-logger
Description: pino logging koa middleware
Latest version: 2.1.5

# koa-pino-logger

This is a minor fork of `koa-pino-logger` (https://github.com/pinojs/koa-pino-logger).

Published to npm out of necessity because merge is still pending in the original repo (seems unmaintained).

For info, how it is used, benchmarks, etc, see the original repo.

This repo is snapshot at 2.1.3, and it is what would become by accepting https://github.com/pinojs/koa-pino-logger/pull/26.

Therefore is v2.1.4.
npm package: @juntoz/koa-require-header
Description: Koa middleware to require an http header and write to state variable
Author: Juntoz.com
Latest version: 1.0.6

# koa-require-header

This package contains a middleware that will require an http header to be present on the request, and if present, it will write the value into a state variable.

To install the package
```
npm install @juntoz/koa-require-header
```

To use it
```
const koaRequireHeader = require('@juntoz/koa-require-header');

var koaApp = new Koa();

koaApp.use(koaRequireHeader({ /*options*/ }));
```

Where options is an object that can contain the following fields
```
{
    headerName: null, // header name that should come in the request to validate and match
    stateName: null, // optional ctx.state property name when the header is found. If null, the headerName is converted to camelCase.
    ifNotFound: 'throw' // set what to do if the header is not found. Possible values ['throw', 'ignore'].
}
```
npm package: @juntoz/mini-console-logger
Description: Mini logger to the console with colors
Author: Juntoz.com
Latest version: 1.0.1

# mini-console-logger

Just very simple logger to use and configure

## Usage

Add dependency to project
`npm i @juntoz/mini-console-logger`

Use in your code
```
const logger = require('@juntoz/mini-console-logger');
logger.level = logger.consts.INFO;

// ...

logger.debug('My debug');
logger.info('My info');
logger.warn('My warn');
logger.error('My error');

// based on the current level, it will show
My info
My warn
My error
```

## Colors
Uses the `colors` library

error: red
warn: yellow
info: (no color assigned)
debug: grey
npm package: @juntoz/str-bounds
Description: Utility to add or remove a character from the start or end of a string. Useful to build a url, query, etc.
Author: Juntoz.com
Latest version: 1.0.0

# str-bounds
Utility library to add or remove a character from the start or end of a string.

Useful to build urls, queries, etc.

# How to install?
```
npm install @juntoz/str-bounds
```

# How to use?
```
const bounds = require('@juntoz/str-bounds');

var urlpath = 'mypath';
bounds.ensureInitSlash(urlpath);
// => /mypath

var urlhost = 'http://github.com';
bounds.ensureFinalSlash(urlhost);
// => http://github.com/

```