open-index/open-npm huggingface dataset:
npm package: @ln-juggernaut/proto-loader
Description: gRPC utility library for loading .proto files
Author: Google Inc.
Latest version: 0.5.3

# gRPC Protobuf Loader

A utility package for loading `.proto` files for use with gRPC, using the latest Protobuf.js package.
Please refer to [protobuf.js' documentation](https://github.com/dcodeIO/protobuf.js/blob/master/README.md)
to understands its features and limitations.

## Installation

```sh
npm install @grpc/proto-loader
```

## Usage

```js
const protoLoader = require('@grpc/proto-loader');
const grpcLibrary = require('grpc');
// OR
const grpcLibrary = require('@grpc/grpc-js');

protoLoader.load(protoFileName, options).then(packageDefinition => {
  const packageObject = grpcLibrary.loadPackageDefinition(packageDefinition);
});
// OR
const packageDefinition = protoLoader.loadSync(protoFileName, options);
const packageObject = grpcLibrary.loadPackageDefinition(packageDefinition);
```

The options parameter is an object that can have the following optional properties:

| Field name | Valid values | Description
|------------|--------------|------------
| `keepCase` | `true` or `false` | Preserve field names. The default is to change them to camel case.
| `longs` | `String` or `Number` | The type to use to represent `long` values. Defaults to a `Long` object type.
| `enums` | `String` | The type to use to represent `enum` values. Defaults to the numeric value.
| `bytes` | `Array` or `String` | The type to use to represent `bytes` values. Defaults to `Buffer`.
| `defaults` | `true` or `false` | Set default values on output objects. Defaults to `false`.
| `arrays` | `true` or `false` | Set empty arrays for missing array values even if `defaults` is `false` Defaults to `false`.
| `objects` | `true` or `false` | Set empty objects for missing object values even if `defaults` is `false` Defaults to `false`.
| `oneofs` | `true` or `false` | Set virtual oneof properties to the present field's name. Defaults to `false`.
| `includeDirs` | An array of strings | A list of search paths for imported `.proto` files.

The following options object closely approximates the existing behavior of `grpc.load`:

```js
const options = {
  keepCase: true,
  longs: String,
  enums: String,
  defaults: true,
  oneofs: true
}
```
npm package: @ln-maf/filltemplate
Description: Fills the template literals similar to how js would handle them.  Allows use of template literal in a string.  There are a couple of key differences with how they are processed by fillTemplate.
Latest version: 1.0.8

# Fill template
Fills the template literals similar to how js would handle them.  Allows use of template literal in a string.  There are a couple of key differences with how they are processed by fillTemplate.

## Installation
Install it with
```
npm i @ln-maf/filltemplate
```
## Usage
```
var fillTemplate=require('fillTemplate')
fillTemplate.fillTemplate("Hello ${name}", { name: "World" })
var jsonObj={ hello: "${name}" }
fillTemplate.applyTemplateToJSON(jsonObj, { name: "World" })
console.log(jsonObj)
```

For example: 
```
fillTemplate("Hello ${name}", { name: "World" })
```
Would return:
```
Hello world
```

Additionally supports the method `applyTemplateToJSON`
This iterates through the entire json object applying filter to each of them.

For Example:

```
var jsonObj={ hello: "${name}" }
applyTemplateToJSON(jsonObj, { name: "World" })
```
Would apply:
```
{
  "hello" : "World"
}
```
to the `jsonObj`.


## Differences
All `"${JS_COMMAND_HERE}"` are replaced with `${JSON.stringify(command)}`.  This automatically escapes some characters to prevent invalid json within json files.

The items are evaled on within each bracket.  You can see some of the examples within the features subfolder of this project.
npm package: @ln-maf/mysql
Description: Setup for sql on Node
Latest version: 4.1.9

# Node Sql Setup

This module is created to allow other projects to easily utilize SQL when writing test cases.  Additionally, a utility function is used to test using this.

[![npm package][npm-image]][npm-url] 
[![GitHub Actions](https://github.com/hpcc-systems/MAF/workflows/Build/badge.svg)](https://github.com/hpcc-systems/MAF/actions)
[![Dependencies][dep-image]][dep-url]


# Setup

To use this you must require this library after installing using npm.
```
npm i @ln-maf/mysql
```

# Set up configs

Keytar is used to store access to the username and password for sql.  
To setup an sql config please run the following from project root:
```
node node_modules/@ln-maf/mysql/config.js
```
Note: Please run the Setup step first.


## Steps
Add a step definition file with the following line:
```
require('@ln-maf/mysql)
```

## Given mysql config from [{jsonObject}](../validations/JSONObject.md)
Utilizes the sql system associated with the item provided.  By default will use `mysql.sqlConfig.json` in the root directory of the project if none is provided.

## When mysql query from [{jsonObject}](../validations/JSONObject.md) is run
Runs a query from the provided item.  Allows templated args as per the global cucumber projects.  Stores the results in `this.results.lastRun`.  Usable in cucubmer as `${lastRun}` or the it keyword.

[npm-image]:https://img.shields.io/npm/v/@ln-maf/mysql.svg
[npm-url]:https://www.npmjs.com/package/@ln-maf/mysql-sql
npm package: @ln-maf/postgresql
Description: PostgreSQL support / step definitions for MAF
Latest version: 4.1.9

# MAF PostgreSQL Setup

This module is created to allow other projects to easily utilize PostgreSQL when writing test cases.  Additionally, a utility function is used to test using this.

# Setup

To use this you must require this library after installing using npm.
```
npm i @ln-maf/postgresql
```

# Set up configs

Keytar is used to store access to the username and password for sql. Alternatively, Environment Variables Can be used as well. The following environment variables are used:
- POSTGRESQL_SQL_USERNAME: Your username for postgresql
- POSTGRESQL_SQL_PASSWORD: Your password for postgresql
- USE_ENV_VARIABLES: Set to `TRUE` to use environment variables instead of keytar.

To setup an sql config please run the following from your project root:
```
node node_modules/@ln-maf/postgresql/config.js
```
Or create a JSON with the name `postgresql.sqlConfig.json` in the root directory of your project.  The following is an example of the JSON:
```
{
    "host": "localhost",
    "port": 5432,
    "database": "database"
}
```

## Steps
Add a step definition import file with the following line so that the following postgresql steps are available:
```
require('@ln-maf/postgresql)
```

## Given postgresql config from [{jsonObject}](../validations/JSONObject.md)
Utilizes the sql system associated with the item provided. By default will use `postgresql.sqlConfig.json` in the root directory of the project if none is provided.

## When postgresql query from [{jsonObject}](../validations/JSONObject.md) is run
Runs a query from the provided item. Allows templated args as per the global cucumber projects. Stores the results in `this.results.lastRun`. Usable in cucumber as `${lastRun}` or the it keyword.

[npm-image]:https://img.shields.io/npm/v/@ln-maf/postgresql.svg
[npm-url]:https://www.npmjs.com/package/@ln-maf/postgresql-sql
npm package: @ln-zap/comlink-loader
Description: Webpack loader: offload modules to Worker threads seamlessly using Comlink
Author: The Chromium Authors
Latest version: 1.2.1

<p align="center">
  <img src="https://i.imgur.com/cLb2dLG.jpg" width="600" alt="comlink-loader">
</p>
<h1 align="center">🛰 comlink-loader 📡</h1>
<p align="center">Offload modules to Worker threads seamlessly using <a href="https://github.com/GoogleChromeLabs/comlink">Comlink</a>.</p>


### Features

- Offload almost any module into a Worker with little or no usage change
- Supports arbitrary classes, objects & functions (`await new Foo()`)
- Works beautifully with async/await
- Built-in code-splitting: workers are lazy-loaded


## Installation

```sh
npm install -D comlink-loader
```


## Usage

The goal of `comlink-loader` is to make the fact that a module is running inside a Worker nearly transparent to the developer.

In the example below, the sole difference between running `MyClass` on a Worker thread instead of the main thread is that instantiation and method calls must be prefixed with `await`. This is required because Worker interactions are inherently asynchronous.

**my-class.js**: _(gets moved into a worker)_

```js
// Dependencies get bundled into the worker:
import rnd from 'random-int';

// Export as you would in a normal module:
export class MyClass {
  constructor(value = rnd()) {
    this.value = value;
  }
  increment() {
    this.value++;
  }
  // Tip: async functions make the interface identical
  async getValue() {
    return this.value;
  }
}
```

**main.js**: _(our demo, on the main thread)_

```js
import { MyClass } from 'comlink-loader!./my-class';

const inst = await new MyClass(42); // notice the await

await inst.increment();

await inst.getValue();  // 43
```

## License

Apache-2.0