open-index/open-npm huggingface dataset:
npm package: @pod-point/utils
Description: Common JS utilities.
Author: POD Point
Latest version: 1.5.0

# Common utilities

## Import

    import { functionName } from '@pod-point/utils';

## Functions

### each

    each(object, callback);

Performant object iteration. `callback` is provided `(value, key, object)`:

    each(object, (value) => console.log(value));

### throttle

    throttle(callback, limit = 35);

Prevent a function from firing more than once every `limit` milliseconds. `limit` defaults to `35` for roughly 30 frames per second.

### whenCalm
    
    whenCalm(callback, timeout = 250);

Fires a function **only** when it hasn't been requested for `timeout` milliseconds.
npm package: @pod-point/winston-kinesis
Description: Winston logging transport for logging into Amazon AWS Kinesis Data Stream
Author: Pod Point Software Team
Latest version: 1.0.7

[![Build Status](https://travis-ci.org/Pod-Point/winston-kinesis-transport.svg?branch=master)](https://travis-ci.org/Pod-Point/winston-kinesis-transport)

# Winston AWS Kinesis Transport

NodeJS module, winston logging transport which writes to AWS Kinesis Data Stream.

## Installation
[![NPM](https://nodei.co/npm/@pod-point/winston-kinesis.png)](https://npmjs.org/package/@pod-point/winston-kinesis)
```bash
npm install @pod-point/winston-kinesis
```

## Usage

You can add this logger transport with the following code:

```javascript
var winston = require('winston');
var KinesisTransport = require('@pod-point/winston-kinesis');

// register the transport
var logger = winston.createLogger({
    transports: [
      new KinesisTransport({
        'streamName': 'kinesis_data_stream_name',
        'environment': 'production',
        'kinesisOptions': {
          'region': 'us-east-1'
        }
      })
    ]
  });

// log away!!
// with just a string
logger.info('This is the log message!');

// or with meta info
logger.info('This is the log message!', { snakes: 'delicious' });
```

This will write messages as strings (using JSON.stringify) into Kinesis in the following format:
```
{
  timestamp: 2016-05-20T22:48:01.106Z,
  level: "info",
  message: "This is the log message!",
  meta: { snakes: "delicious" }
};
```

## Options

`streamName (string) - required` The name of the Kinesis data stream to write to.

`kinesisOptions (object) - optional/suggested` The Kinesis options that are passed directly to the constructor,
 [documented by AWS here](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Kinesis.html#constructor-property)

## Details

At the moment this logger sends (unacknowledged!) log messages into firehose. Right now the behavior if the log
message fails to write to Kinesis is simply to do absolutely nothing and fail silently.

## Credits

Originally forked from [`winston-firehose`](https://github.com/pkallos/winston-firehose).
npm package: @poddify/aws-common
Description: Utilities for interacting with AWS resources
Author: Poddify
Latest version: 0.1.0

# @poddify/aws-common

Utilities for interacting with AWS resources

This module seeks to simplify your interactions with AWS resources by providing simpler interfaces than your standard `aws-sdk` consumption.

## Supported Resources

This module is always evolving to add and enhance support. Pull requests are welcome.

* SNS
* DynamoDB
* ...more coming soon!

## Installation

```
$ npm i --save @poddify/aws-common
```

## Usage

### SNS

#### `publish(topic, subject, message)`

Publish an event to an SNS topic

```js
await sns.publish(TOPIC_ARN, 'some subject', 'a message');
```

### DynamoDB

All DynamoDB methods expose an optional `config` parameter. This `config` parameter maps directly to the AWS DynamoDB configuration document by the parent SDK:

```js
const config = {
    region: 'us-east-1',
    endpoint: 'http://localhost:8000' // for local development
    accessKeyId: 'Keep this secret',
    secretAccessKey: 'DEFINITELY keep this secret'
};
```

#### `put(item, table, config)`

Performs an update to an existing DynamoDB record (if indices match) or creates a new record if an existing record is not found.

```js
import { dynamodb } from '@poddify/aws-common';

await dynamodb.put({
    id: 'some-id',
    hash: 'some-hashed-value'
}, DYNAMO_DB_TABLE);
```

#### `get(record, table, config)`

Gets a unique record that matches a given `index` : `value` on the default index

```js
import { dynamodb } from '@poddify/aws-common';

const value = await dynamodb.get({
    'my-index': indexValue
}, DYNAMO_DB_TABLE);
```

### `query(index, query, table, config)`

Gets a set of records that match the `query` object when compared against a specific Index

```js
import { dynamodb } from '@poddify/aws-common';

const results = await dynamodb.query('myIndex', {
    hashKey: hashValue,
    sortKey: sortValue
}, DYNAMO_DB_TABLE)
```
npm package: @poddify/eslint-config-poddify
Description: eslint config for reuse across projects
Author: Poddify
Latest version: 1.1.0

# eslint-config-poddify

An eslint config for reuse across projects

## Installation

```bash
$ npm i --save-dev @poddify/eslint-config-poddify
```

## Usage

In your `.eslintrc`

```json
{
    "extends": "@poddify/eslint-config-poddify",
    "rules": {
        "your project": "your rules"
    }
}
```
npm package: @poddify/mailer
Description: Lightweight email library (powered by Mailgun)
Author: Poddify
Latest version: 0.0.3

# @poddify/mailer

A lightweight library for sending email using Mailgun

## Installation

```
$ npm i --save @poddify/mailer
```

## Usage

```js
import Mailer from '@poddify/mailer';

const mailer = new Mailer({
    apiKey: MAILGUN_API_KEY,
    domain: MAILGUN_DOMAIN
});
```

### mailer.send

Sends an email

| Option   | Description        |
|----------|--------------------|
| from     | from email address |
| to       | to email address   |
| subject  | subject line       |
| template | email HTML         |
| data     | template data      |

#### Example

```js
mailer.send({
    from: FROM_EMAIL,
    to: TO_EMAIL,
    subject: SUBJECT,
    template: EMAIL_TEMPLATE,
    data: EMAIL_TEMPLATE_DATA
});
```

## Email Templates

Email templates are expected to be HTML contents and are provided to `mailer.send` via the `template` parameter. The HTML string provided will be injected with data using the `data` parameter. To inject string data into your email body, simply add `{{DATA_PARAM}}` within the HTML contents, where `DATA_PARAM` is the object key in `options.data`

```js
mailer.send({
    template: '<h1>{{title}}</h1>',
    data: {
        title: 'Hello World'
    }
});
```
npm package: @podex/cli
Description: Podex CLI - AI-powered coding assistant for cloud and local development
Author: Podex
Latest version: 0.0.1

# @podex/cli

Scoped alias for the main `podex` package.

## Installation

Install the main package:

```bash
npm install -g podex
```

## Learn More

- Website: https://podex.dev
- Documentation: https://docs.podex.dev
- GitHub: https://github.com/podex/podex
npm package: @podiceps/auth
Description: auth middleware
Author: loeify
Latest version: 1.0.2

# Podiceps auth middleware

wait for login before request

```bash
$ npm i @podiceps/auth -S
```

## Usage

```ts
import auth from '@podiceps/auth'

const { login, logout, middleware } = auth()

podiceps.use([middleware])

login() // after login, start request

logout() // logout

// ignore login config
import Podiceps from '@podiceps/core'

const configs = {
  next: {
    path: '/next',
    login: false, // not need login to request
  },
}
```
npm package: @podiceps/core
Description: podiceps
Author: loeify
Latest version: 1.0.1

# Podiceps

A middleware design library for request

## Install

```bash
$ npm i @podiceps/core -S
```

## Usage

```ts
import Podiceps, { Configs, Middleware } from '@podiceps/core'

type Response = {
  c: number,
  m: string,
  d: Record<string, any>,
}
type Apis = Configs<'user' | 'posts'>

const middlewares: Middleware<Response> = {
  before(config) {
    config.timeout = 5000
  },
  async success(_config, data) {
    data.d.success = await new Promise((r) => {
      setTimeout(r, 1000, 'success')
    })
  },
  complete(_config, data) {
    if (data) {
      data.d.complete = 'complete'
    }
  },
}
const apis: Apis = {
  user: {
    path: '/user',
  },
  posts: {
    method: 'POST',
  },
}

const podiceps = new Podiceps<Apis, Response>(
  apis,
  {
    baseURL: 'http://a.url',
  },
)
podiceps.use([middlewares])
podiceps.adaptor = async (config): Promise<Response> => {
  const { path } = config
  return new Promise((resolve) => setTimeout(resolve, 1000, {
    c: 0,
    d: { path },
    m: '',
  }))
}
const ctx = podiceps.create()
```

## API

### context

create context width configs and response type

```ts
new Podiceps<Configs, Response>(configs)
```

### middlewares

```ts
// before
type before = (config: Config) => Promise<void> | void

// success
type success = (config: Config, data: Response) => Promise<void> | void

// error
type error = (config: Config, error: Error) => Promise<void> | void

// complete
type complete = (config: Config, data?: Response, error?: Error) => Promise<void> | void
```

### use

use middlewares

```ts
type use = (middlewares: Middleware[]) => void
```

### adaptor

set adaptor for request

```ts
set adaptor(adaptor: Adaptor<Response>)
```

### create

get the context

```ts
type create = () => void
```

## Flow

```
before -> adaptor -> success -> complete
                  -> error -> complete
```
npm package: @podiceps/fetch
Description: adaptor fetch
Author: loeify
Latest version: 1.0.2

# Podiceps adaptor fetch

fetch

```bash
$ npm i @podiceps/fetch -S
```

## Usage

```ts
import fetchAdaptor from '@podiceps/fetch'

type R = { c: string }

podiceps.adaptor = (config) => fetchAdaptor<R>(config)
```
npm package: @podium/bridge
Description: This package is a bridge designed to pass [JSON-RPC 2.0](https://www.jsonrpc.org/specification) messages between a web application and a native web view.
Latest version: 1.2.5

# `@podium/bridge`

This package is a bridge designed to pass [JSON-RPC 2.0](https://www.jsonrpc.org/specification) messages between a web application and a native web view.

## Usage

To install:

```sh
npm install @podium/bridge
```

Import the bridge in your client-side bundle:

```js
import '@podium/bridge';
```

You should probably send messages via [`@podium/browser`](https://github.com/podium-lib/browser). That said, the bridge is available on `window['@podium'].bridge`.

```js
/** @type {import("@podium/bridge").PodiumBridge} */
const bridge = window['@podium'].bridge;

// You can listen for incoming messages, which can either be RpcRequest or RpcResponse
bridge.on('global/authentication', (message) => {
	const request =
		/** @type {import("@podium/bridge").RpcRequest<{ token?: string }>} */ (
			message
		);

	if (typeof request.token === 'string') {
		// logged in
	} else {
		// logged out
	}
});

// You can trigger notifications (one-way messages)
bridge.notification({
	method: 'global/authentication',
	params: { token: null },
});

// And you can call methods and await the response
/** @type {import("@podium/bridge").RpcResponse<{ c: string }>} */
const response = await bridge.call({
	method: 'document/native-feature',
	params: { a: 'foo', b: 'bar' },
});
```

## API

### `bridge.on`

Add a listener for incoming messages for a given method name.

```js
import '@podium/bridge';

/** @type {import("@podium/bridge").PodiumBridge} */
const bridge = window['@podium'].bridge;

bridge.on('global/authentication', (message) => {
	const request =
		/** @type {import("@podium/bridge").RpcRequest<{ token?: string }>} */ (
			message
		);

	if (typeof request.token === 'string') {
		// logged in
	} else {
		// logged out
	}
});
```

### `bridge.notification`

Send a [notification](https://www.jsonrpc.org/specification#notification) (one-way message).

```js
import '@podium/bridge';

/** @type {import("@podium/bridge").PodiumBridge} */
const bridge = window['@podium'].bridge;

bridge.notification({
	method: 'global/authentication',
	params: { token: null },
});
```

### `bridge.call`

Send a [request](https://www.jsonrpc.org/specification#request_object) and await a [response](https://www.jsonrpc.org/specification#response_object).

```js
import '@podium/bridge';

/** @type {import("@podium/bridge").PodiumBridge} */
const bridge = window['@podium'].bridge;

/** @type {import("@podium/bridge").RpcResponse<{ c: string }>} */
const response = await bridge.call({
	method: 'document/native-feature',
	params: { a: 'foo', b: 'bar' },
});
```
npm package: @podium/dev-tool
Description: Development tool to improve the experience of working on Podium podlets
Author: Richard Walker
Latest version: 5.0.15

# @podium/dev-tool

Tool that exposes a development API on Podium podlets for use in [browser development tools](../client).

## Getting started

Install the developer tool module:

```sh
npm install @podium/dev-tool
```

Then configure it in your podlet:

```js
import express from "express";
import Podlet from "@podium/podlet";
import DevTool from "@podium/dev-tool";

const app = express();

const podlet = new Podlet({
	name: "myPodlet",
	version: "1.0.0",
	pathname: "/",
	development: true,
});

podlet.defaults({
	token: "as3d24asd34asd4",
	mountOrigin: "/testing",
});

const devTool = new DevTool({
	logger: console,
});
devTool.register(podlet);

app.use(podlet.middleware());

app.get(podlet.manifest(), (req, res) => {
	res.json(podlet);
});

app.get(podlet.content(), (req, res) => {
	res.json({ context: res.locals.podium.context });
});

app.listen(7100);
await devTool.start();
```

## Endpoints

```js
// GET http://localhost:8172/
// GET http://localhost:8172/podlet
// GET http://localhost:8172/podlet/:name
// GET http://localhost:8172/context
// GET http://localhost:8172/context/:name
// POST http://localhost:8172/context
// POST http://localhost:8172/context/:name
```
npm package: @podium/semantic-release-config
Description: Shared semantic release config used in Podium modules
Latest version: 3.0.5

# @podium/semantic-release-config

This is a [semantic-release](https://github.com/semantic-release/semantic-release) config to publish Podium modules meant for internal use in the [podium-lib organisation](https://github.com/podium-lib).

## Plugins

This shareable configuration uses the following plugins:

- [`@semantic-release/commit-analyzer`](https://github.com/semantic-release/commit-analyzer)
- [`@semantic-release/release-notes-generator`](https://github.com/semantic-release/release-notes-generator)
- [`@semantic-release/changelog`](https://github.com/semantic-release/changelog)
- [`@semantic-release/npm`](https://github.com/semantic-release/npm)
- [`@semantic-release/github`](https://github.com/semantic-release/github)
- [`@semantic-release/git`](https://github.com/semantic-release/git)

## Install

```bash
npm install --save-dev semantic-release @podium/semantic-release-config
```

## Usage

In the [semantic-release configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):

```js
export default {
	extends: "@podium/semantic-release-config",
};
```
npm package: @podium/test-utils
Description: Misc common test utils for Podium
Author: Trygve Lie
Latest version: 3.0.26

# Test Utils

A set of misc test utilities used by tests in the different podium modules.

## Installation

```bash
$ npm install @podium/test-utils --save-dev
```

This module contain the following utils:

 * [PodletServer](/lib/podlet-server) - A dummy Podlet server with misc hooks to tap into manipulate the server on the fly.
 * [HttpsServer](/lib/https-server) - A simple https server with a request hook to insert a simple response.
 * [HttpServer](/lib/http-server) - A simple http server with a request hook to insert a simple response.
 * [request](/lib/http-request) - A simple http request client.
 * [destinationObjectStream](/lib/stream-utils) - A stream util to pipe Objects into. Calls a callback with all Objects streamed into it when done.
 * [destinationBufferStream](/lib/stream-utils) - A stream util to pipe Buffer chunks into. Calls a callback with a String of all buffer chunks when done.

 ## License

Copyright (c) 2019 FINN.no

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
npm package: @podium/typescript-config
Description: Shared typescript config for Podium modules
Latest version: 1.0.1

# @podium/typescript-config

Shared config for TypeScript, used in Podium projects to generate type definitions from JSDoc and test them.

## Install

```
npm install --save-dev typescript @podium/typescript-config
```

## Usage

Create two files in your root directory.

`tsconfig.json` (assuming source in `lib/`):

```json
{
    "extends": "@podium/typescript-config/module.json",
    "include": ["./lib/**/*.js"],
    "compilerOptions": {
        "outDir": "types"
    }
}
```

`tsconfig.test.json` (assuming tests in `tests/`):

```json
{
    "extends": "@podium/typescript-config/test.json",
    "include": ["./tests/**/*.js"]
}
```

You should have a similar setup in your `package.json`:

```json
{
    "scripts": {
        "types": "run-s types:module types:test",
        "types:module": "tsc",
        "types:test": "tsc --project tsconfig.test.json"
    },
    "dependencies": {
        "npm-run-all2": "6.2.3"
    }
}
```