open-index/open-npm huggingface dataset:
npm package: @mosuke_mkii/csv-file
Description: CSVファイルを操作するモジュール
Author: mosuke_mkii
Latest version: 1.0.4

# CsvFile

`CsvFile` は、`Node.js` で CSV ファイルを簡単に扱うためのモジュールです。<br>
CSV ファイルの読み込み、書き込み、行の追加などの機能を提供します。

## 機能

- CSV ファイルの新規作成とヘッダーの追加
- 既存の CSV ファイルへの行の追加
- CSV ファイルの読み込みとオブジェクトへの変換
- ヘッダーの検証
- 特定のカラムの値に基づく行の集計
- 特定の文字列を含む行の削除

## インストール

```bash
npm install @mosuke_mkii/csv-file
```

## 使い方

以下は `CsvFile` モジュールの基本的な使用例です：

```javascript
const CsvFile = require('@mosuke_mkii/csv-file');

(async () => {
  // CSVファイルの新規作成とヘッダーの追加
  const csvFile = new CsvFile({
    headers: ['Name', 'Age', 'Gender'],
    path: 'example.csv'
  });
  await csvFile.createOnlyHeader();

  // 既存のCSVファイルへの行の追加
  await csvFile.append([
    ['John Doe', '30', 'Male'],
    ['Jane Doe', '25', 'Female']
  ]);

  // CSVファイルの読み込みとオブジェクトへの変換
  const rows = await csvFile.convertCsvToArray();
  console.log(rows);
  /*
  output:
    [
      { Name: 'John Doe', Age: '30', Gender: 'Male' },
      { Name: 'Jane Doe', Age: '25', Gender: 'Female' }
    ]
  */
})();
```

## ライセンス

このプロジェクトは [MIT ライセンス](https://github.com/YukinobuKurata/YouTubeMagicBuyButton/blob/master/MIT-LICENSE.txt) の下で公開されています。
npm package: @mosure/host-panel-db-connector
Description: DynamoDB Wrapper for Host-Panel
Author: Sudo.X LLC
Latest version: 1.0.3

# Database Connector for Host-Panel
To install `@mosure/host-panel-db-connector`.

## Using the Connector
Note, setting the appropriate endpoint/region via `AWS.config...` is required before using connector components.

## Testing
Run unit tests with `npm run test`.

### Integration Testing with AWS DynamoDB
Run a local DynamoDB docker image via:
`docker run -p 8000:8000 amazon/dynamodb-local`

Run integration tests (requires AWS DynamoDB endpoint, default is localhost) with `npm run integration -- --endpoint http://localhost:8000`.

## Games Connector
#### Get:
```typescript
const gamesConnector = new GamesConnector();

gamesConnector.get({
    id: 'GAME0'
})
.subscribe((game: Game) => {
    // TODO: Use the game
});
```

#### Put:
```typescript
const gamesConnector = new GamesConnector();

gamesConnector.put({
    id: 'GAME2',
})
.subscribe((valid: boolean) => {
    // TODO: Use the result
});
```

#### Update:
```typescript
const gamesConnector = new GamesConnector();

gamesConnector.update({
    id: 'GAME2',
    name: 'New Name',
})
.subscribe((valid: boolean) => {
    // TODO: Use the result
});
```

#### Delete:
```typescript
const gamesConnector = new GamesConnector();

gamesConnector.delete({
    id: 'GAME2',
})
.subscribe((valid: boolean) => {
    // TODO: Use the result
});
```
npm package: @mosure/host-panel-load-test-db
Description: Load test Host-Panel data
Author: Sudo.X LLC
Latest version: 1.0.5

# Load Test Host-Panel Data
Make sure you have DynamoDB running locally on port `8000`

Build the script: `npm run build`.

Run `npm run load-db`.

## Using Test Data
Install `npm install @mosure/host-panel-load-test-db` to access test data objects.

## Test Table Convention
Note: the first item in each `data` array is a 'complete' data object.

## Optional Arguments
Don't load test data: `npm run load-db -- --no-data`

Specify an alternate DynamoDB endpoint: `npm run load-db -- --endpoint http://localhost:8000`
npm package: @mosure/lambda-auth-middleware
Description: OAuth Token Validation
Author: Sudo.X LLC
Latest version: 1.0.7

# Authenticator

Implements [`middy v1.x` AWS Lambda Middleware](https://github.com/middyjs/middy/tree/1.0.0-beta) to provide token authentication to serverless endpoints.

## Implementation

Run `npm install @middy/core` to add middy to your project.

Run `npm install @mosure/lambda-auth-middleware` to install to your project.

Run `npm install @middy/http-error-handler` to install the error handler.

To implement this middleware into your AWS Lambda follow the code sample below:

```typescript
import { Context, APIGatewayProxyResult, APIGatwayProxyCallback } from 'aws-lambda';
import middy from '@middy/core';
import httpErrorHandler from '@middy/http-error-handler';

import { authorize, AuthMiddlewareConfig } from '@mosure/lambda-auth-middleware';


// Optional token payload and validator
interface TokenPayload {
    somePayloadValue: string;
}

const isPayload = (payload: any): payload is TokenPayload => {
    return payload && payload['somePayloadValue'];
}

// Your AWS Lambda function
const myLambdaFunction = (event: AuthEvent<TokenPayload>, context: Context, callback: APIGatewayProxyCallback) => {
    // Optionally access JWT payload
    if (event.auth.payload.somePayloadValue !== 'TEST') {
        // TODO: handle bad payload
    }

    // TODO: Business Logic (post-authentication)
};

const authConfig: AuthMiddlewareConfig = {
    credentialsRequired: !process.env.NODE_DEBUG, // Force authorization header to exist
    secret: process.env.JWT_SECRET,
    algorithm: 'HS256',
    audience: process.env.JWT_AUDIENCE,
    isPayload
};

const handler = middy(myLambdaFunction)
    .use(httpErrorHandler())
    .use(authorize(authConfig));
```
npm package: @mosuzi/tiny-ajax
Description: A very simple ajax.
Author: mosuzi
Latest version: 1.0.0

# Tiny Ajax

A very simple ajax.

## Install

```shell
npm install --save @mosuzi/tiny-ajax
```

## Usage

```javascript
import TinyAjax from '@mosuzi/tiny-ajax'

const data = { id: 'fakeId' }

// async
const result = TinyAjax.ajax('get', '<api address>', data)
result.then((resp) => {
  // do business actions
})

// sync
const result = TinyAjax.ajax('get', '<api address>', data, { async: false })
// do business actions
```

**`resp.responseData` or `result.responseData` is parsed data**

## Api

### ajax()

```typescript
ajax: (method: string, url: string, params: any, { timeout, async, ignoreRequestInterceptors, ignoreResponseInterceptors }: {
  timeout: number;
  async: boolean;
  ignoreRequestInterceptors: boolean;
  ignoreResponseInterceptors: boolean;
}) => any;
```

- method: Request method, such as `get`
- url: Request url
- params: Request data
- options
  - timeout: Request timeout. Ignored when `async` sets __false__
  - async: Indicates if the request is asynchronous. Defaults to __true__. When set to __false__, `ajax()` return response, otherwise return a promise
  - ignoreRequestInterceptors: Indicates if ignore request interceptors
  - ignoreResponseInterceptors: Indicates if ignore response interceptors

### addInterceptorsRequest()

```typescript
addInterceptorsRequest: (name: string, action: (e: any) => any) => void;
```

- name: Interceptor name
- action: Interceptor

### addInterceptorsResponse()

```typescript
addInterceptorsResponse: (name: string, action: (e: any) => any) => void;
```

- name: Interceptor name
- action: Interceptor

### setAjaxConfig()

```typescript
setAjaxConfig: ({ baseUrl, timeout }?: AjaxConfig) => void;
```

- Params: See `Type/AjaxConfig`

### getAjaxConfig()

```typescript
getAjaxConfig: () => AjaxConfig;
```

- Return value: See `Type/AjaxConfig`

## Type

### AjaxConfig

```typescript
declare type AjaxConfig = {
  baseUrl?: string
  timeout?: number
}
```

- baseUrl: Prefix of request url. When sending request, final url equals to baseUrl splices url _which is specified by `ajax()`_
- timeout: Default value of request timeout
npm package: @mota.alyson/replace-variables
Description: Simple library to renaming variables in string
Author: alysonmota
Latest version: 0.0.6

A simple javascript/typescript library for renaming variables within string.

<br />

### Why did I create this libray?
this library was created just solve a use case in another project.
So you probrably won´t need to use this.
But if not, feel free to use and modify this code.

<br />

### Use example
replaceVariables(str: string, separator_pattern: string, values: Record<string, string>): string

```ts
import { replaceVariables, SeparatorPattern } from 'replace-variables'

const base_url = 'https://shop.com/product/[id]/details'

const url_with_id = replaceVariables(base_url, SeparatorPattern.Bracket, {
  id: 'my-id'
}) // => https://shop.com/product/my-id/details
```

<br />

replaceVariablesWithUsedValues(str: string, separator_pattern: string, variable_position, Record<string, string>): [string, Array\<string\>]

same replaceVariables but returns values that have been used 
```ts
import { replaceVariablesWithUsedValues, SeparatorPattern } from 'replace-variables'

const base_url = 'https://shop.com/product/:id/details'

replaceVariablesWithUsedValues(base_url, SeparatorPattern.Colon, {
  id: 'my-id'
}) // => [https://shop.com/product/my-id?color=red&size=, [my-id]]
```

<br />

replaceVariableOnPosition(str: string, separator_pattern: string, variable_position: number, value: string): string

```ts
import { replaceVariableOnPosition, SeparatorPattern } from 'replace-variables'

const base_url = 'https://shop.com/product/my-id?color=&size='

replaceVariableOnPosition(base_url, SeparatorPattern.LikeUrlParameter, 1, 'red') // => https://shop.com/product/my-id?color=red&size=

replaceVariableOnPosition(base_url, SeparatorPattern.LikeUrlParameter, 2, 'large') // => https://shop.com/product/my-id?color=&size=large
```

### Supported patterns
Colon ```:my-varaible```

At ```@my-variable```

LikeUrlParameter ```?my-variable=```

Parentheses ```(my-variable)```

Braces ```{my-variable}```

Brackets ```[my-variable]```