open-index/open-npm huggingface dataset:
npm package: @pancakeswap/v4-sdk
Description: ⚒️ An SDK for building applications on top of Pancakeswap V4
Latest version: 0.1.8

# PancakeSwap V4 SDK

PancakeSwap V4 Official SDK, used for PancakeSwap Interface and interacting with [PancakeSwap V4 smart contracts](https://github.com/pancakeswap/pancake-v4-core).

## Usage

### CLAMM Pool

TBD

### Bin Pool

in Bin Pool, we use symbol `Y` and `X` to represent the two tokens in the pool. Like the `1` and `0` in CLAMM Pool.


- [getBinPool](./src/functions/bin/getBinPool.ts): Get the bin pool with state
- [getIdFromPrice](./src/functions/bin/getIdFromPrice.ts): Get the bin id from given price
- [getPriceFromId](./src/functions/bin/getPriceFromId.ts): Get the price from given bin id
- [getNextNonEmptyBin](./src/functions/bin/getNextNonEmptyBin.ts): Get the next non-empty bin
- [swap](./src/functions/bin/swap.ts): Dry run Swap tokens in bin pool, return the state after swap

### Utils for both CLAMM and Bin Pool

- [getPoolId](./src/utils/getPoolId.ts): Get the pool id from given PoolKey
- [getSortedCurrencies](./src/utils/getSortedCurrencies.ts): Returns the sorted currencies from given
- [encodeHooksRegistration](./src/utils/encodeHooksRegistration.ts): hooks registration option encoder
- [encodePoolParameters](./src/utils/encodePoolParameters.ts): pool parameters encoder

## Contributing

```sh
pnpm install
pnpm run test
```
npm package: @pancakeswap2/sdk
Description: 🛠 An SDK for building applications on top of ForbitSwap.
Latest version: 0.1.5

# Juiceswap SDK


## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/Juiceswap-finance/Juiceswap-sdk.git
```

Move into the Juiceswap-sdk working directory

```sh
cd Juiceswap-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @pancakeswapnews/uikit
Description: Set of UI components for pancake projects
Latest version: 0.56.12

# 🥞 Pancake UIkit

[![Version](https://img.shields.io/npm/v/@pancakeswap-libs/uikit)](https://www.npmjs.com/package/@pancakeswap-libs/uikit) [![Size](https://img.shields.io/bundlephobia/min/@pancakeswap-libs/uikit)](https://www.npmjs.com/package/@pancakeswap-libs/uikit)

Pancake UIkit is a set of React components and hooks used to build pages on Pancake's apps. It also contains a theme file for dark and light mode.

## Install

`yarn add @pancakeswap-libs/uikit`

## Setup

### Theme

Before using Pancake UIkit, you need to provide the theme file to styled-component.

```
import { ThemeProvider } from 'styled-components'
import { light, dark } from '@pancakeswap-libs/uikit'
...
<ThemeProvider theme={isDark}>...</ThemeProvider>
```

### Reset

A reset CSS is available as a global styled component.

```
import { ResetCSS } from '@pancakeswap-libs/uikit'
...
<ResetCSS />
```

### Types

This project is built with Typescript and export all the relevant types.

## How to use the UIkit

If you want to use components from the UIkit, check the [Storybook documentation](https://pancakeswap.github.io/pancake-uikit/)
npm package: @pancakewizard/uikit
Description: Set of UI components for pancakewizard projects
Latest version: 1.3.1

# BecoSwap UIkit

[![Version](https://img.shields.io/npm/v/@becoswap-libs/uikit)](https://www.npmjs.com/package/@becoswap-libs/uikit) [![Size](https://img.shields.io/bundlephobia/min/@becoswap-libs/uikit)](https://www.npmjs.com/package/@becoswap-libs/uikit)

BecoSwap UIkit is a set of React components and hooks used to build pages on BecoSwap's apps. It also contains a theme file for dark and light mode.

## Install

`yarn add @becoswap-libs/uikit`

## Setup

### Theme

Before using Becoswap UIkit, you need to provide the theme file to styled-component.

```
import { ThemeProvider } from 'styled-components'
import { light, dark } from '@becoswap-libs/uikit'
...
<ThemeProvider theme={isDark}>...</ThemeProvider>
```

### Reset

A reset CSS is available as a global styled component.

```
import { ResetCSS } from '@becoswap-libs/uikit'
...
<ResetCSS />
```

### Types

This project is built with Typescript and export all the relevant types.

## How to use the UIkit

If you want to use components from the UIkit, check the [Storybook documentation](https://becoswap.github.io/becoswap-uikit/)
npm package: @pancato/dep-checker
Description: 🪵 dep detector
Latest version: 1.0.1

# modern-starter-ts

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![bundle][bundle-src]][bundle-href]
[![JSDocs][jsdocs-src]][jsdocs-href]
[![License][license-src]][license-href]

🏙️ A modern typescript starter

## License

[MIT](./LICENSE) License © [pancat.ooo](https://github.com/oolongstack)
npm package: @pancato/modern-starter-ts
Description: 🏙️ A modern typescript starter
Latest version: 0.1.3

# modern-starter-ts

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![bundle][bundle-src]][bundle-href]
[![JSDocs][jsdocs-src]][jsdocs-href]
[![License][license-src]][license-href]

🏙️ A modern typescript starter

## License

[MIT](./LICENSE) License © [pancat.ooo](https://github.com/oolongstack)
npm package: @pancato/react-starter
Description: 🌞 A minimist starter template for react typescript library
Author: pancato
Latest version: 1.0.6

# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

```js
export default tseslint.config({
  extends: [
    // Remove ...tseslint.configs.recommended and replace with this
    ...tseslint.configs.recommendedTypeChecked,
    // Alternatively, use this for stricter rules
    ...tseslint.configs.strictTypeChecked,
    // Optionally, add this for stylistic rules
    ...tseslint.configs.stylisticTypeChecked,
  ],
  languageOptions: {
    // other options...
    parserOptions: {
      project: ["./tsconfig.node.json", "./tsconfig.app.json"],
      tsconfigRootDir: import.meta.dirname,
    },
  },
});
```

You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:

```js
// eslint.config.js
import reactX from "eslint-plugin-react-x";
import reactDom from "eslint-plugin-react-dom";

export default tseslint.config({
  plugins: {
    // Add the react-x and react-dom plugins
    "react-x": reactX,
    "react-dom": reactDom,
  },
  rules: {
    // other rules...
    // Enable its recommended typescript rules
    ...reactX.configs["recommended-typescript"].rules,
    ...reactDom.configs.recommended.rules,
  },
});
```
npm package: @panda-ai/claw-sdk
Description: Pure TypeScript SDK for standard OpenClaw gateway API calls
Latest version: 0.1.0

# Claw SDK

Pure TypeScript SDK for standard OpenClaw gateway API calls.

`claw-sdk` wraps OpenClaw chat and tool endpoints into an agent-oriented API so your app can call stable methods instead of manually building HTTP payloads.

## Features

- Pure TypeScript with full type exports
- Built-in runtime adapters: OpenClaw and NanoClaw
- Agent abstraction with auto conversation memory
- Streaming support (`stream + onChunk`)
- One-shot calls (`run`) that do not affect memory
- Tool invocation support (`agent.use`)
- Multi-agent lifecycle management
- Typed error hierarchy for gateway failures

## Install

```bash
pnpm add claw-sdk
```

Node.js `>=18.17` is required.

## Quick Start

```ts
import { Claw } from "claw-sdk"

const os = new Claw({
  gatewayUrl: "http://localhost:18789",
  token: process.env.CLAW_GATEWAY_TOKEN ?? "your-gateway-token",
  runtime: "openclaw",
  defaultModel: "openclaw",
})

const assistant = os.agent({
  name: "assistant",
  systemPrompt: "You are concise and practical.",
})

const first = await assistant.send("My name is Alex.")
const second = await assistant.send("What is my name?")

console.log(first)
console.log(second)
```

## Streaming

```ts
const text = await assistant.send("Write a short haiku about coding.", {
  stream: true,
  onChunk: (chunk) => process.stdout.write(chunk),
})
```

## One-shot Prompt

```ts
const summary = await assistant.run("Summarize: TypeScript SDKs improve DX.")
```

## Tool Use

```ts
const result = await assistant.use("web-search", { query: "OpenClaw release notes" })
```

## NanoClaw Runtime

```ts
const os = new Claw({
  gatewayUrl: "http://localhost:18789",
  token: process.env.CLAW_NANOCLAW_TOKEN ?? "your-nanoclaw-token",
  runtime: "nanoclaw",
  defaultModel: "claude-3-5-sonnet-latest",
})
```

`nanoclaw` adapter uses Anthropic-compatible endpoints (`/v1/messages`, `/v1/models`).
Direct `agent.use()` tool invocation is currently only supported by the `openclaw` adapter.

## API Overview

```ts
const os = new Claw(config)
const agent = os.agent("assistant")

await agent.send("...")
await agent.run("...")
await agent.use("tool-id", { ...params })

agent.reset()
os.close("assistant")
await os.ping()
```

## Errors

- `ClawError`: base SDK error
- `GatewayConnectionError`: network/connection failure on ping
- `AgentNotFoundError`: closing a non-existing agent

## Docs

- Getting started: `docs/getting-started.md`
- API reference: `docs/api-reference.md`
- OpenClaw test coverage: `docs/openclaw-test-coverage.md`
- Examples: `docs/examples/*`

## Development

```bash
pnpm install
pnpm typecheck
pnpm lint
pnpm test
pnpm build
```

Real gateway integration test (optional):

```bash
cp .env.real.example .env.real
pnpm test:real
```

Optional env vars: `CLAW_REAL_MODEL`, `CLAW_REAL_TIMEOUT_MS`, `CLAW_REAL_TOOL_ID`, `CLAW_REAL_TOOL_PARAMS_JSON`.

## License

MIT
npm package: @panda-ai/image
Description: In browser image compression, powered by WASM (imagequant)
Author: Isaac Liu
Latest version: 0.2.2

# @panda-ai/image

> Template to kickstart creating a Node.js module using TypeScript and VSCode

Inspired by [node-module-boilerplate](https://github.com/sindresorhus/node-module-boilerplate)

## Features

- [Semantic Release](https://github.com/semantic-release/semantic-release)
- [Issue Templates](https://github.com/Panda-Intelligence/image/tree/main/.github/ISSUE_TEMPLATE)
- [GitHub Actions](https://github.com/Panda-Intelligence/image/tree/main/.github/workflows)
- [Codecov](https://about.codecov.io/)
- [VSCode Launch Configurations](https://github.com/Panda-Intelligence/image/blob/main/.vscode/launch.json)
- [TypeScript](https://www.typescriptlang.org/)
- [Husky](https://github.com/typicode/husky)
- [Commitizen](https://github.com/search?q=commitizen)
- [Prettier](https://prettier.io/)


### Add NPM Token

Add your npm token to your GitHub repository secrets as `NPM_TOKEN`.

### Add Codecov integration

Enable the Codecov GitHub App [here](https://github.com/apps/codecov).

**Remove everything from here and above**

---

# @panda-ai/image

[![npm package][npm-img]][npm-url]
[![Build Status][build-img]][build-url]
[![Downloads][downloads-img]][downloads-url]
[![Issues][issues-img]][issues-url]
[![Code Coverage][codecov-img]][codecov-url]
[![Commitizen Friendly][commitizen-img]][commitizen-url]
[![Semantic Release][semantic-release-img]][semantic-release-url]

> My awesome module

## Install

```bash
npm install @panda-ai/image
```

## Usage

```ts
import { myPackage } from '@panda-ai/image';

myPackage('hello');
//=> 'hello from my package'
```

[build-img]:https://github.com/Panda-Intelligence/image/actions/workflows/release.yml/badge.svg
[build-url]:https://github.com/Panda-Intelligence/image/actions/workflows/release.yml
[downloads-img]:https://img.shields.io/npm/dt/typescript-npm-package-template
[downloads-url]:https://www.npmtrends.com/typescript-npm-package-template
[npm-img]:https://img.shields.io/npm/v/typescript-npm-package-template
[npm-url]:https://www.npmjs.com/package/typescript-npm-package-template
[issues-img]:https://img.shields.io/github/issues/ryansonshine/typescript-npm-package-template
[issues-url]:https://github.com/Panda-Intelligence/image/issues
[codecov-img]:https://codecov.io/gh/ryansonshine/typescript-npm-package-template/branch/main/graph/badge.svg
[codecov-url]:https://codecov.io/gh/ryansonshine/typescript-npm-package-template
[semantic-release-img]:https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[semantic-release-url]:https://github.com/semantic-release/semantic-release
[commitizen-img]:https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
[commitizen-url]:http://commitizen.github.io/cz-cli/
npm package: @panda-ai/imagequant
Description: imagequant wasm port for png compress in JavaScript runtime
Latest version: 0.2.0

# @panda-ai/imagequant

[![License: GPL v3](https://img.shields.io/badge/License-MIT-blue.svg)](https://www.gnu.org/licenses/mit)

High-performance WebAssembly port of imagequant (libimagequant) for color quantization in browsers. Achieves 2-4x faster processing compared to JS implementations.

## Features

- 🔥 WASM accelerated color quantization
- 🎨 Alpha transparency support
- 📦 80kb gzipped WASM bundle
- 🚀 Zero-copy memory operations
- 📱 Web Worker compatible

## Installation

### npm
```bash
bun install @panda-ai/imagequant
```

## Quick Start

```javascript
  import WasmImageQuant, { PNGEncoder } from '@panda-ai/imagequant'

  const iq = await WasmImageQuant.create();
  const filePath = path.resolve(__dirname, './boat.png')
  const file = Bun.file(filePath);
  const arrayBuffer = await file.arrayBuffer();
  const imageData = await readBufferToImageData(arrayBuffer);

  const { palette, indices } = iq.quantize(imageData);

    // Generate PNG
  const pngData = PNGEncoder.encode(
    palette,
    indices,
    imageData.width,
    imageData.height,
  );

```

## API

### quantize(pixels: Uint8Array, width: number, height: number, options): QuantResult

| Option      | Default | Description                     |
|-------------|---------|---------------------------------|
| maxColors   | 256     | Maximum palette size (2-256)    |
| speed       | 6       | Speed/quality tradeoff (1-10)   |

Returns:
```typescript
interface QuantResult {
  palette: Uint8Array  // RGBA palette (maxColors × 4 bytes)
  indices: Uint8Array  // Pixel indices (width × height bytes)
}
```

## Performance Benchmarks

| Image Size | Colors | WASM Time | JS Time |
|------------|--------|-----------|---------|
| 512x512    | 128    | 68ms      | 220ms   |
| 1024x768   | 256    | 145ms     | 520ms   |
| 4096x2160  | 256    | 890ms     | 3200ms  |

Tested on Chrome 118, M1 MacBook Pro

## Browser Support

| Browser       | Minimum Version |
|---------------|-----------------|
| Chrome        | 57+             |
| Firefox       | 53+             |
| Safari        | 14.1+           |
| Edge          | 79+             |

## Advanced Usage

### Web Worker Processing
TBD

### Canvas Integration
TBD

## Limitations
TBD

## Building from Source

1. Install Rust toolchain
2. Install wasm-pack
```bash
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
```
3. Build package
```bash
wasm-pack build --target web
```

## License

MIT © Panda Intelligence. Commercial licenses available.
npm package: @panda-clouds/action
Description: The Action library for the Pages SDK Library
Author: Marc Smith
Latest version: 0.1.0


PCAction
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`PCAction` is the "Action" library for the Pages SDK Clients.


Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save @panda-clouds/action
```

Usage
-----

### Node.js

```javascript
const PCAction = require('@panda-clouds/action');

// example usage

```

You can replace PCAction with any variable.


Methods
-------

[Unit Tests] are an additional resource for learning functionality.

### - mustExist()

requires the property to be set,
else throws error

Example:

```javascript
Parse.Cloud.beforeSave('Book', request =>{
	let button = PCAction.alertButton('ok');
	return PCAction.showAlert('oops!','We couldn\'t find your account',[]); // =>
	/*
{
  "type": "showAlert",
  "title": "oops!",
  "message": "We couldn't find your account",
  "buttons": [
    {
      "title": "ok",
      "action": {
        "type": "nothing"
      }
    }
  ]
}
	*/
});
```



Contributions
-------------

Pull requests are welcome! here is a checklist to speed things up:

- modify `PCAction.js`
- add unit tests in `PCAction.spec.js`
- run `npm test`
- document method in `README.md`
- add your name to 'Contributors' in `README.md`


### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)


[Unit Tests]: https://github.com/panda-clouds/string/blob/master/spec/PCAction.spec.js
npm package: @panda-clouds/address-formatter
Description: Standardizes addresses from user input strings
Author: Marc Smith
Latest version: 2.4.2


PCAddressFormatter
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`PCAddressFormatter` is a lightweight JavaScript library for Node.js that provides formatting of postal addresses.


Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save @panda-clouds/address-formatter
```

Usage
-----

### Node.js

```javascript
const PCAddressFormatter = require('@panda-clouds/address-formatter');

// example usage
PCAddressFormatter.street('123 North Happy Street'); // => '123 N Happy St';
PCAddressFormatter.city('San Antonio'); // => 'San Antonio';
PCAddressFormatter.state('Arizona'); // => 'AZ';
PCAddressFormatter.country('United States of America'); // => 'US';
PCAddressFormatter.zipCode(85234); // => '85234';
```

You can replace PCAddressFormatter with any variable.


Methods
-------

[Unit Tests] are an additional resource for learning functionality.

### - street(input)

Example:

```javascript
PCAddressFormatter.street('123 North Happy Street'); // => '123 N Happy St;
```

### - city(input)

Example:

```javascript
PCAddressFormatter.city('San Antonio'); // => 'San Antonio';
```

### - state(input)

Example:

```javascript
PCAddressFormatter.state('Arizona'); // => 'AZ';
```

### - country(input)

Example:

```javascript
PCAddressFormatter.country('United States of America'); // => 'US';
```

### - zipcode(input)


Example:

```javascript
PCAddressFormatter.zipcode(85234); // => '85234';
```




Contributions
-------------

Pull requests are welcome! here is a checklist to speed things up:

- modify `PCAddressFormatter.js`
- add unit tests in `PCAddressFormatter.spec.js`
- run `npm test`
- document method in `README.md`
- add your name to 'Contributors' in `README.md`


### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)


[Unit Tests]: https://github.com/panda-clouds/string/blob/master/spec/PCAddressFormatter.spec.js
npm package: @panda-clouds/address-preview
Description: Picks a random point from within a redius around an address
Author: Marc Smith
Latest version: 0.19.0


PCString
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`PCString` is a lightweight JavaScript library for Node.js that provides additional String methods.


Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save @panda-clouds/string
```

Usage
-----

### Node.js

```javascript
const PCString = require('@panda-clouds/string');

// example usage
PCString.isString('yup!'); // => true;
PCString.hasWhitespace('ABC'); // => false;
```

You can replace PCString with any variable.


Methods
-------

[Unit Tests] are an additional resource for learning functionality.

### - isString(string)

Returns whether a given object is a String.

Example:

```javascript
PCString.isString('ABC') // => true
PCString.isString(5) // => false
PCString.isString({}) // => false
PCString.isString([]) // => false
```

### - hasWhiteSpace(string)

returns true if the string has white space, false if not.


Example:

```javascript
PCString.hasWhitespace(' ') // => true
PCString.hasWhitespace('A B') // => true
PCString.hasWhitespace('AB') // => false
PCString.hasWhitespace('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-!@#$%^&*()') // => false
```


### - removeWhitespace(string)

Removes all white characters from the given string.

Example:

```javascript
PCString.removeWhitespace(' A B  C   D    ') // => 'ABCD'
PCString.removeWhitespace('	A	B	C			D	') // => 'ABCD'
PCString.removeWhitespace('\nA\nB\n\nC\n\n\nD\n\n\n\n') // => 'ABCD'
PCString.removeWhitespace(null) // => ''
```

### - domainSafeString(string)

Removes all non-domain-safe characters.

Example:

```javascript
PCString.domainSafeString('_A_B__C___D____') // => 'ABCD'
PCString.domainSafeString('	A	B	C			D	') // => 'ABCD'
PCString.domainSafeString('\nA\nB\n\nC\n\n\nD\n\n\n\n') // => 'ABCD'
PCString.domainSafeString(null) // => ''
```


Contributions
-------------

Pull requests are welcome! here is a checklist to speed things up:

- modify `PCString.js`
- add unit tests in `PCString.spec.js`
- run `npm test`
- document method in `README.md`
- add your name to 'Contributors' in `README.md`


### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)


[Unit Tests]: https://github.com/panda-clouds/string/blob/master/spec/PCString.spec.js
npm package: @panda-clouds/birthday
Description: PCBirthday ========= maintained by [PandaClouds.com](https://pandaclouds.com)
Author: Marc Smith
Latest version: 0.1.3


PCBirthday
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`PCBirthday`  Calcuates age in years,  in months if child is below 2 years old and in days if child is below 1 month old.


Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save @panda-clouds/birthday
```

Usage
-----

### Node.js

```javascript
const PCBirthday = require('@panda-clouds/birthday');

// example usage

```

You can replace PCBirthday with any variable.


Methods
-------

[Unit Tests] are an additional resource for learning functionality.

### - mustExist()

requires the property to be set,
else throws error

Example:

```javascript
Parse.Cloud.beforeSave('Book', request =>{
	const data = new PCBirthday(request);
	data.prop('title').mustExist();    // will throw Error if request.object.get('title') doesn't exist
});
```



Contributions
-------------

Pull requests are welcome! here is a checklist to speed things up:

- modify `PCBirthday.js`
- add unit tests in `PCBirthday.spec.js`
- run `npm test`
- document method in `README.md`
- add your name to 'Contributors' in `README.md`


### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)
      [Noor Aboud](https://github.com/nusa232)



[Unit Tests]: https://github.com/panda-clouds/string/blob/master/spec/PCBirthday.spec.js
npm package: @panda-clouds/chat
Description: <description>
Author: Marc Smith
Latest version: 0.2.0


<PCName>
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`<PCName>` provides a clean way to <description>.


Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save @panda-clouds/<panda-blank>
```

Usage
-----

### Node.js

```javascript
const <PCName> = require('@panda-clouds/<panda-blank>');

// example usage

```

You can replace <PCName> with any variable.


Methods
-------

[Unit Tests] are an additional resource for learning functionality.

### - mustExist()

requires the property to be set,
else throws error

Example:

```javascript
Parse.Cloud.beforeSave('Book', request =>{
	const data = new <PCName>(request);
	data.prop('title').mustExist();    // will throw Error if request.object.get('title') doesn't exist
});
```



Contributions
-------------

Pull requests are welcome! here is a checklist to speed things up:

- modify `<PCName>.js`
- add unit tests in `<PCName>.spec.js`
- run `npm test`
- document method in `README.md`
- add your name to 'Contributors' in `README.md`


### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)


[Unit Tests]: https://github.com/panda-clouds/string/blob/master/spec/<PCName>.spec.js
npm package: @panda-clouds/date
Description: A helper class for javascript date
Author: Marc Smith
Latest version: 1.2.0


PCDate
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`PCDate` is a lightweight JavaScript library for Node.js that provides additional Date methods.


Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save @panda-clouds/date
```

Usage
-----

### Node.js

```javascript
const PCDate = require('@panda-clouds/date');

// example usage
PCDate.isDate(new Date()); // => true;
PCDate.addTime(new Date(), 1, 'hour'); // => a date object that is 1 hour in the future;
```

You can replace PCDate with any variable.


Methods
-------

[Unit Tests] are an additional resource for learning functionality.

### - isDate(date)

Returns whether a given object is a Date.

Example:

```javascript
PCDate.isDate(new Date()) // => true
PCDate.isDate('ABC') // => false
PCDate.isDate(5) // => false
PCDate.isDate({}) // => false
PCDate.isDate([]) // => false
```

### - addTime(date,number,unit)

returns a date object offset by the number and unit

units can be
- years
- months
- weeks
- days
- hours
- minutes
- seconds

Example:

```javascript
PCDate.addTime(new Date(), 5, 'seconds') // => 5 seconds in the future
PCDate.addTime(new Date(), -3, 'hours') // => 3 hours in the past
PCDate.addTime(new Date(), 1, 'week') // => 1 week in the future
```


Contributions
-------------

Pull requests are welcome! here is a checklist to speed things up:

- modify `PCDate.js`
- add unit tests in `PCDate.spec.js`
- run `npm test`
- document method in `README.md`
- add your name to 'Contributors' in `README.md`


### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)


[Unit Tests]: https://github.com/panda-clouds/string/blob/master/spec/PCDate.spec.js
npm package: @panda-clouds/docker-machine
Description: allows the use of docker-machine from node
Author: Marc Smith
Latest version: 1.5.0


PCDockerMachine
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`PCDockerMachine` provides a clean way to validate data in Parse Sever Cloud Code.


Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save @panda-clouds/docker-machine
```

Usage
-----

### Node.js

```javascript
const PCDockerMachine = require('@panda-clouds/docker-machine');

const options = {};
options['digitalocean-access-token'] = '< my DigitalOcean Token >';

// Create the machine on Digital Ocean
const machine = await DockerMachine.create('machine-test', 'digitalocean', options);

const status = await machine.status();  // => 'Running'
const IPv4 = await machine.getIPv4();   // => '123.234.321.21'
const allMachines = await Machine.ls(); // => [{'name':'machine-test'...},{'name':'other-machine'...}]

// Destroy the machine 
await machine.destroy();

const status = await machine.status(); // => 'Machine Not Found'
```

You can replace PCDockerMachine with any variable.


Methods
-------

[Unit Tests] are an additional resource for learning functionality.

### - status()

returns the status of the machine

Example:

```javascript
const status = await machine.status() // => 'Running'
```



Contributions
-------------

Pull requests are welcome! here is a checklist to speed things up:

- modify `PCDockerMachine.js`
- add unit tests in `PCDockerMachine.spec.js`
- run `npm test`
- document method in `README.md`
- add your name to 'Contributors' in `README.md`


### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)


[Unit Tests]: https://github.com/panda-clouds/string/blob/master/spec/PCDockerMachine.spec.js
npm package: @panda-clouds/docker-machine-providers
Description: A unified interface to spin up and manage servers on various cloud providers
Author: Marc Smith
Latest version: 0.4.0


PCProviders
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`PCProviders` provides a wrapper for the `@panda-clouds/docker-machine` npm package for a unified interface in spining up and managing cloud servers.


Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save @panda-clouds/docker-machine-providers
```

Usage
-----

### Node.js

```javascript
const DigitalOcean = require('@panda-clouds/docker-machine-providers').DigitalOcean;

// example usage

```

Methods
-------

[Unit Tests] are an additional resource for learning functionality.

### - mustExist()

requires the property to be set,
else throws error

Example:

```javascript
Parse.Cloud.beforeSave('Book', request =>{
	const data = new PCProviders(request);
	data.prop('title').mustExist();    // will throw Error if request.object.get('title') doesn't exist
});
```



Contributions
-------------

Pull requests are welcome! here is a checklist to speed things up:

- modify `PCProviders.js`
- add unit tests in `PCProviders.spec.js`
- run `npm test`
- document method in `README.md`
- add your name to 'Contributors' in `README.md`


### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)


[Unit Tests]: https://github.com/panda-clouds/string/blob/master/spec/PCProviders.spec.js
npm package: @panda-clouds/eslint-config-panda-clouds
Description: An ESLint config for standardizing Panda Clouds Projects.
Author: Marc Smith
Latest version: 1.3.0

Panda Clouds ESLint Config
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

An ESLint config for standardizing Panda Clouds Projects.

Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save-dev @panda-clouds/eslint-config-panda-clouds
```

4. run the following command:

```
cat << 'EOF' > .eslintrc.js
module.exports = {
    extends: '@panda-clouds/eslint-config-panda-clouds',
    rules: {},
};
EOF
```
npm package: @panda-clouds/idempotency
Description: Ensures that multiple save attempts only result in a single object
Author: Marc Smith
Latest version: 0.5.0


PCIdempotency
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`PCIdempotency` provides a clean way to ensure that multiple save attempts only result in a single object.


Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save @panda-clouds/idempotency
```

Usage
-----

### Node.js

```javascript
const PCIdempotency = require('@panda-clouds/idempotency');

// example "beforeSave" usage

// example generic ussage with Parse
await PCIdempotency.check('Foo', Parse); // pass
await PCIdempotency.check('Bar', Parse); // pass
await PCIdempotency.check('Bar', Parse); // throws because 456 has already been given

// example generic ussage without Parse
// Note: without parse we only remember the last 500 keys
await PCIdempotency.check('123'); // pass
await PCIdempotency.check('456'); // pass
await PCIdempotency.check('456'); // throws because 456 has already been given
```

You can replace PCIdempotency with any variable.


Methods
-------

[Unit Tests] are an additional resource for learning functionality.

### - checkOnCreate(key, Parse)

will throw an error if the object contains a duplicate value for the key "idempotencyKey"

Example:

// Parse Server v3.x
```javascript
Parse.Cloud.beforeSave('MyObject', async request => {
	await PCIdempotency.checkOnCreate(request, Parse)
})
```
// Parse Server v2.x
```javascript
Parse.Cloud.beforeSave('MyObject', (request, response) => {
	return Parse.Promise.as()
	.then(()=>{
	  return PCIdempotency.checkOnCreate(request, Parse)
	})
	.then(()=>{
		response.success('yay');
	},(error)=>{
		response.error(error);
	})
})
```

### - check(key, Parse)

will throw an error if we have used that key before

Example:

```javascript
await PCIdempotency.check('myKey')
// better yet, to add persistance, use
await PCIdempotency.check('myKey', Parse)
```



Contributions
-------------

Pull requests are welcome! here is a checklist to speed things up:

- modify `PCIdempotency.js`
- add unit tests in `PCIdempotency.spec.js`
- run `npm test`
- document method in `README.md`
- add your name to 'Contributors' in `README.md`


### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)


[Unit Tests]: https://github.com/panda-clouds/string/blob/master/spec/PCIdempotency.spec.js
npm package: @panda-clouds/number
Description: A javascript helper class for numbers
Author: Marc Smith
Latest version: 1.0.0


PCNumber
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`PCNumber` is a lightweight JavaScript library for Node.js that provides additional Number methods.


Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save @panda-clouds/number
```

Usage
-----

### Node.js

```javascript
const PCNumber = require('@panda-clouds/number');

// example usage
PCNumber.isNumber(5) // => true
PCNumber.isNumber("5") // => false
```

You can replace PCNumber with any variable.


Methods
-------

[Unit Tests] are an additional resource for learning functionality.

### - isNumber()

returns if the object is a number object

Example:

```javascript
PCNumber.isNumber(-5) // => true
PCNumber.isNumber(0) // => true
PCNumber.isNumber(5) // => true

PCNumber.isNumber("5") // => false
PCNumber.isNumber(null) // => false
PCNumber.isNumber() // => false
```

Contributions
-------------

Pull requests are welcome! here is a checklist to speed things up:

- modify `PCNumber.js`
- add unit tests in `PCNumber.spec.js`
- run `npm test`
- document method in `README.md`
- add your name to 'Contributors' in `README.md`


### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)


[Unit Tests]: https://github.com/panda-clouds/string/blob/master/spec/PCNumber.spec.js
npm package: @panda-clouds/parse-bash
Description: A node helper class for accessing the hosts bash shell using promises
Author: Marc Smith
Latest version: 2.1.0


PCBash
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`PCBash` is a lightweight JavaScript library for Node.js that provides additional Bash methods.


Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save @panda-clouds/parse-bash
```

Usage
-----

### Node.js

```javascript
const PCBash = require('@panda-clouds/parse-bash');

// example usage
PCBash.runCommandPromise('pwd')
	.then((result)=>{
		console.log(result) // => "/path/to/my/dir";
	});

PCBash.putStringInFile('Hello World!',"/tmp/hello-world")
	.then((result)=>{
		PCBash.runCommandPromise('cat "/tmp/hello-world"')
			.then((result)=>{
				console.log(result) // => "Hello World!";
			});
	}); 
```

You can replace PCBash with any variable.


Methods
-------

[Unit Tests] are an additional resource for learning functionality.

### - runCommandPromise(string)

Returns a promise that is resolved with the contents of stdout.

Example:

```javascript
PCBash.runCommandPromise('pwd')
	.then((result)=>{
		console.log(result) // => "/path/to/my/dir";
	});
```

### - putStringInFile(string)

places the contents of the string into the file path provided


Example:

```javascript
PCBash.putStringInFile('Hello World!',"/tmp/hello-world")
	.then((result)=>{
		PCBash.runCommandPromise('cat "/tmp/hello-world"')
			.then((result)=>{
				console.log(result) // => "Hello World!";
			});
	}); 
```

Contributions
-------------

Pull requests are welcome! here is a checklist to speed things up:

- modify `PCBash.js`
- add unit tests in `PCBash.spec.js`
- run `npm test`
- document method in `README.md`
- add your name to 'Contributors' in `README.md`


### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)


[Unit Tests]: https://github.com/panda-clouds/string/blob/master/spec/PCBash.spec.js
npm package: @panda-clouds/parse-data
Description: Cleanly verify data in Parse-Server hooks and functions
Author: Marc Smith
Latest version: 0.6.0


PCData
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`PCData` provides a clean way to validate data in Parse Sever Cloud Code.


Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save @panda-clouds/parse-data
```

Usage
-----

### Node.js

```javascript
const PCData = require('@panda-clouds/parse-data');

// example usage
Parse.Cloud.beforeSave('Book', request =>{
	const data = new PCData(request);

	// will throw Error if request.object.get('title') doesn't exist
	data.prop('title').mustExist();

	// Chain requirements together
	data.prop('author').mustExist().mustNotChange();
});
```

You can replace PCData with any variable.


Methods
-------

[Unit Tests] are an additional resource for learning functionality.

### - mustExist()

requires the property to be set,
else throws error

Example:

```javascript
Parse.Cloud.beforeSave('Book', request =>{
	const data = new PCData(request);
	data.prop('title').mustExist();    // will throw Error if request.object.get('title') doesn't exist
});
```

### - mustNotChange()

requires the property to be the same as the first time ACUTUALLY SETTING IT,
else throws error

Note: undefined => value will NOT throw an error
Consider the following
1. the object is saved WITHOUT setting the property.
2. the object is saved again WITH setting the property.
3. this will pass

Example:

```javascript
Parse.Cloud.beforeSave('Book', request =>{
	const data = new PCData(request);
	data.prop('title').mustNotChange();    // will throw Error if request.object.get('title') is not equal to request.original.get('title')
});
```

### - mustBeBefore(propName)

Requires that the property be before the property specified by propName.

Note: only supported in Parse v3.

Example:

```javascript
Parse.Cloud.beforeSave('TimePeriod', request => {
	const data = new PCData(request);

	data.prop('start').mustBeBefore('end');	// will throw Error if start or end are not Date objects or if start is not before end.
});
````


Contributions
-------------

Pull requests are welcome! here is a checklist to speed things up:

- modify `PCData.js`
- add unit tests in `PCData.spec.js`
- run `npm test`
- document method in `README.md`
- add your name to 'Contributors' in `README.md`


### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)
- [*] [Scott Runyon](https://github.com/east-empire)


[Unit Tests]: https://github.com/panda-clouds/string/blob/master/spec/PCData.spec.js
npm package: @panda-clouds/parse-params
Description: Parameter util for Parse Cloud functions
Author: Scott Runyon
Latest version: 0.5.0


new-npm-module
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`new-npm-module` provides a clean way to create a new Panda Clouds npm module.


Usage
-----

1. Create the desired "new" repo on github. We will use a "birthday" module as an example
2. clone "new" into directory "X"
3. clone this project into the same directory "X"
4. open terminal
5. cd /my/dirX
6. replace the "birthday" in this script with the name of your "new" repo
```
export NEW_NPM_PROJECT="birthday" && ls ./${NEW_NPM_PROJECT} && cp -r ./new-npm-module/* ./${NEW_NPM_PROJECT} && cp ./new-npm-module/.eslintignore ./${NEW_NPM_PROJECT} && cp ./new-npm-module/.eslintrc.js ./${NEW_NPM_PROJECT} && cp ./new-npm-module/.gitignore ./${NEW_NPM_PROJECT} && cp ./new-npm-module/.npmrc-deploy ./${NEW_NPM_PROJECT} && rm ./${NEW_NPM_PROJECT}/README.md && mv ./${NEW_NPM_PROJECT}/new_README.md ./${NEW_NPM_PROJECT}/README.md
```
7. paste the command in to termial and press "enter"
8. commit and push the "new" repo to github
9. rename src/<PCName>.js with "PCBirthday.js" or equivelant
9. rename spec/<PCName>.spec.js with "PCBirthday.spec.js" or equivelant
9. rename <PCName> in "spec/PCBirthday.spec.js" or equivelant
9. in "README.md" AND "package.json" replace all:
	- "<PCName>" with "PCBirthday" or equivelant
	- "<panda-blank>" with "birthday" or equivelant
	- "<description>" with a one line secription of the module
11. README.md: in the "Methods" section: Document all methods with examples
11. README.md: in the "Usage" section: add an "end to end" example that uses all the functions together

### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)
npm package: @panda-clouds/parse-runner
Description: Spins up dockerized Parse Server and Mongo instances for testing
Author: Marc Smith
Latest version: 0.49.0


PCParseRunner
=========
maintained by [PandaClouds.com](https://pandaclouds.com)

`PCParseRunner` spins up dockerized "Parse Server" and "Mongo" instances for testing.


Installation
------------

1. If you want to use this library, you first need to install the [Node.js](https://nodejs.org/en/).

2. When you install node.js, will also be installed [npm](https://www.npmjs.com/).

3. Please run the following command.

```
npm install --save-dev @panda-clouds/parse-runner
```

Usage
-----

### Node.js

```javascript
const PCParseRunner = require('@panda-clouds/parse-runner');
let Parse;

describe('a describe block', () => {

	const parseRunner = new PCParseRunner();

	parseRunner.parseVersion(version);

	// begin optional cloud code
	const cloud =
`
Parse.Cloud.define('myFunction', function(request, response) {
	return 'myResults';
});
`;
	parseRunner.cloud(cloud);
	// end optional cloud code

	beforeAll(async () => {
		Parse = await parseRunner.startParseServer();
	}, 1000 * 60 * 2);

	afterAll(async () => {
		await parseRunner.cleanUp();
	});

	it('should call a Parse function', async () => {
		const result = await Parse.Cloud.run('myFunction');

		expect(result).toBe('myResults');
		expect(result).not.toBe('superman');
	});
})
```

You can replace PCParseRunner with any variable.


Methods
-------

[Unit Tests] are the best resource for learning functionality.



Contributions
-------------

Pull requests are welcome! here is a checklist to speed things up:

- modify `PCParseRunner.js`
- add unit tests in `PCParseRunner.spec.js`
- run `npm test`
- document method in `README.md`
- add your name to 'Contributors' in `README.md`


### Contributors

(Add your name)

- [*] [Marc Smith](https://github.com/mrmarcsmith)


[Unit Tests]: https://github.com/panda-clouds/string/blob/master/spec/PCParseRunner.spec.js