open-index/open-npm huggingface dataset:
npm package: @jbuschke/react-fetch-context
Description: A react context that simply exposes fetch, in order to allow reversing the dependency on it
Latest version: 0.3.0

# Usage

```
import * as React from "react"; //typescript
import { FetchContext } from "@jbuschke/react-fetch-context";

function SomeComponent(){
    const fetch = React.useContext(FetchContext)

    return  (<button onClick={() => fetch("my-api").then(response => console.log(response)) }>
                load some data
            </button>);
}

function customizedFetch(path, init){
    // customize init (or even path)
    // for example get cookie or authorization value
    // and set init.headers.Authorization
    // ...
    const customizedInit = { ...init };
    return fetch(path, customizedInit);
}

function MyApp(){
    return (<FetchContext.Provider value={customizedFetch}>
                <SomeComponent />
            </FetchContext.Provider>);
}

```

# Installation

`npm install @jbuschke/react-fetch-context`

# Should I use the library?

This "library" exposes `fetch` as a React Context. The implementation is stupidly simple:

```
export const FetchContext = React.createContext(fetch);
```

If you just develop a single application you should actualy not bring in this library as a dependency. Just implement it yourself or use some other technique to fetch data in your app.

If you are developing several modules, that need to use fetch, this library might be helpful to you. The modules purpose is probably to provide meaningful payloads, but they probably should not care about some headers (for example Authorization), and they would not have a single purpose.

Reacts Context Api allows us to invert the dependency.
npm package: @jbx-protocol/contracts
Description: This repo contains the Juicebox Protocol smart contracts.
Latest version: 0.0.6

# juice-contracts

This repo contains the Juicebox Protocol smart contracts.

It was created at the time of the `V2` rewrite, which requires a full migration from `V1`. `V1` contracts are included for migration tests and posterity, but in general the repo is geared towards `V2` and beyond.

## Develop

To deploy the contracts to a local blockchain, run the following:

```bash
yarn chain --network hardhat
```

To run tests (all, unit, integration):

```bash
yarn test
yarn test:unit
yarn test:integration
```

You can also filter by version, test name, etc.:

```bash
yarn test:unit --grep "ProxyPaymentAddressManager"
```

## Deploy

Juicebox uses the [Hardhat Deploy](https://github.com/wighawag/hardhat-deploy) plugin to deploy contracts to a given network. But before using it, you must create a `./mnemonic.txt` file containing the mnemonic phrase of the wallet used to deploy. You can generate a new mnemonic using [this tool](https://github.com/itinance/mnemonics). Generate a mnemonic at your own risk.

Then, to execute the `./deploy/deploy.js` script, run the following:

```bash
npx hardhat deploy --network $network
```

Contract artifacts will be outputted to `./deployments/$network/**` and should be checked in to the repo.

> **_NOTE:_**  Since we make heavy use of the `skipIfAlreadyDeployed` parameter, if new contract(s) are added, their deployment configuration(s) should be added to the `./deploy/deploy.js` script – not a one-off.

## Verification

To verify the contracts on [Etherscan](https://etherscan.io), make sure you have an `ETHERSCAN_API_KEY` set in your `./.env` file. Then run the following:

```bash
npx hardhat --network $network etherscan-verify
```

This will verify all of the deployed contracts in `./deployments`.
npm package: @jbx-protocol/contracts-v1
Description: ## Develop
Latest version: 2.0.0

# juice-contracts-v1

## Develop

To deploy the contracts to a local blockchain, run the following:

```bash
yarn chain --network hardhat
```

To run tests (all, unit, integration):

```bash
yarn test
yarn test:unit
yarn test:integration
```

You can also filter by version, test name, etc.:

```bash
yarn test:unit --grep "ProxyPaymentAddressManager"
```

## Verification

To verify the contracts on [Etherscan](https://etherscan.io), make sure you have an `ETHERSCAN_API_KEY` set in your `./.env` file. Then run the following:

```bash
npx hardhat --network $network etherscan-verify
```

This will verify all of the deployed contracts in `./deployments`.

If you encounter an error along the lines of the following, compile the problematic contract(s) in isolation first and verify one-by-one:

```
Error in plugin @nomiclabs/hardhat-etherscan: Source code exceeds max accepted (500k chars) length.
```

To compile in isolation:

```
npx hardhat compile:one Tickets
```
npm package: @jbx-protocol/contracts-v2
Description: ## Develop
Latest version: 8.0.4

# juice-contracts-v2

## Develop

### Unit Tests

To run the unit tests suite (in Javascript), you'll need to run `yarn install` first then manually run Hardhat in order to enable ESM support:

```bash
node --require esm ./node_modules/.bin/hardhat test --network hardhat
```

Alternatively, you can run a local Hardhat node in another terminal using

```bash
yarn chain --network hardhat
```

then run the following:

```bash
yarn test
```

It might happens that Hardhat cannot resolve custom error (test failing on "Expecter nameOfTheError() but reverted
without a reason string"), just restart yarn chain.

### System Tests

End-to-end tests have been written in Solidity, using Foundry.

To get set up:

1. Install [Foundry](https://github.com/gakonst/foundry).

```bash
curl -L https://foundry.paradigm.xyz | sh
```

2. Install external lib(s)

```bash
git submodule update --init
```

3. Run tests:

```bash
forge test
```

4. Update Foundry periodically:

```bash
foundryup
```

Resources:

- [The Forge-Book](https://onbjerg.github.io/foundry-book/forge)

### Coverage

To check current unit tests coverage:

```bash
node --require esm ./node_modules/.bin/hardhat coverage --network hardhat
```

A few notes:

- Hardhat doesn't support [esm](https://nodejs.org/api/esm.html) yet, hence running manually with node.
- We are currently using a forked version of [solidity-coverage](https://www.npmjs.com/package/solidity-coverage) that includes optimizer settings. Ideally we will move to the maintained version after this is fixed on their end.
- Juicebox V2 codebase being quite large, Solidity Coverage might run out of memory if you modify/add parts to it. Please check [Solidity-coverage FAQ](https://github.com/sc-forks/solidity-coverage/blob/master/docs/faq.md) in order to address the issue.

## Deploy

Juicebox uses the [Hardhat Deploy](https://github.com/wighawag/hardhat-deploy) plugin to deploy contracts to a given network. But before using it, you must create a `./mnemonic.txt` file containing the mnemonic phrase of the wallet used to deploy. You can generate a new mnemonic using [this tool](https://github.com/itinance/mnemonics). Generate a mnemonic at your own risk.

Then, to execute the `./deploy/deploy.js` script, run the following:

```bash
npx hardhat deploy --network $network
```

\_You'll likely want to set the optimizer runs to 10000 in `./hardhat.config.js` before deploying to prevent contract size errors. The preset value of 1000000 is necessary for hardhat to run unit tests successfully. Bug about this opened [here](https://github.com/NomicFoundation/hardhat/issues/2657#issuecomment-1113890401).

Contract artifacts will be outputted to `./deployments/$network/**` and should be checked in to the repo.

## Verification

To verify the contracts on [Etherscan](https://etherscan.io), make sure you have an `ETHERSCAN_API_KEY` set in your `./.env` file. Then run the following:

```bash
npx hardhat --network $network etherscan-verify
```

This will verify all of the deployed contracts in `./deployments`.
npm package: @jbx-protocol/juice-defifa
Description: ## Motivation
Latest version: 6.0.0

# Juicebox 721 Distribution Mechanism

## Motivation


## Mechanic

## Architecture

## Deploy

# Install

Quick all-in-one command:

```bash
rm -Rf juice-defifa || true && git clone -n https://github.com/jbx-protocol/juice-defifa && cd juice-defifa && git pull origin main && git checkout FETCH_HEAD && foundryup && git submodule update --init --recursive --force && yarn install && forge test
```

To get set up:

1. Install [Foundry](https://github.com/gakonst/foundry).

```bash
curl -L https://foundry.paradigm.xyz | sh
```

2. Install external lib(s)

```bash
git submodule update --init --recursive --force && yarn install
```

then run

```bash
forge update
```

3. Run tests:

```bash
forge test
```

4. Update Foundry periodically:

```bash
foundryup
```

#### Setup

Configure the .env variables, and add a mnemonic.txt file with the mnemonic of the deployer wallet. The sender address in the .env must correspond to the mnemonic account.

## Goerli

```bash
yarn deploy-goerli
```

## Mainnet

```bash
yarn deploy-mainnet
```

The deployments are stored in ./broadcast

See the [Foundry Book for available options](https://book.getfoundry.sh/reference/forge/forge-create.html).
npm package: @jbx-protocol/juice-defifa-nfl-playoff-edition
Description: ## Motivation
Latest version: 1.0.0

# Defifa American Football Playoffs 2023

## Motivation

Iterating on Defifa game.

# Install

Quick all-in-one command:

```bash
rm -Rf juice-defifa || true && git clone -n https://github.com/jbx-protocol/juice-defifa && cd juice-defifa && git pull origin main && git checkout FETCH_HEAD && foundryup && git submodule update --init --recursive --force && yarn install && forge test
```

To get set up:

1. Install [Foundry](https://github.com/gakonst/foundry).

```bash
curl -L https://foundry.paradigm.xyz | sh
```

2. Install external lib(s)

```bash
git submodule update --init --recursive --force && yarn install
```

then run

```bash
forge update
```

3. Run tests:

```bash
forge test
```

4. Update Foundry periodically:

```bash
foundryup
```

#### Setup

Configure the .env variables, and add a mnemonic.txt file with the mnemonic of the deployer wallet. The sender address in the .env must correspond to the mnemonic account.

## Goerli

```bash
yarn deploy-goerli
```

## Mainnet

```bash
yarn deploy-mainnet
```

The deployments are stored in ./broadcast

See the [Foundry Book for available options](https://book.getfoundry.sh/reference/forge/forge-create.html).
npm package: @jbx-protocol/juice-delegates-registry
Description: ## Summary Provide an easy to access function linking Juicebox protocol pay and redemption delegate with their respective deployer address. This registry use create and create2 to, based on a deployer address and a nonce, generate a deterministic address 
Latest version: 1.0.3

# Juice Delegates Registry

## Summary
Provide an easy to access function linking Juicebox protocol pay and redemption delegate with their respective deployer address.
This registry use create and create2 to, based on a deployer address and a nonce, generate a deterministic address for a delegate.
This address is then used as a key to store the deployer address (after sanity check).

## Design
### Flow
After deploying a delegate, any addresses can call `registry.addDelegate(address deployer, uint256 nonce)` to add it. The registry will compute the corresponding 
delegate address, check if it is a valid delegate and add it. Alternatively, addDelegateCreate2(address _deployer, bytes32 _salt, bytes calldata _bytecode) can
be used to add delegate deployed from a contract, using create2.

The frontend might retrieve the correct nonce, for both contract and eoa, using  ethers `provider.getTransactionCount(address)` or web3js `web3.eth.getTransactionCount` just *before* the delegate deployment (if adding a delegate at a later time, manual nonce counting might be needed).
Create2 salt is based on the delegate deployer own internal logic while the deployment bytecode can be retrieved in the deployment transaction (off-chain) or via `abi.encodePacked(type(delegateContract).creationCode, abi.encode(constructorArguments))` (on-chain)

### Contracts/interface
- JBDelegatesRegistry: the registry
- IJBDelegatesRegistry; the registry interface

## Usage
Anyone can deploy this registry using the provided forge script.
To run this repo, you'll need [Foundry](https://book.getfoundry.sh/) and [NodeJS](https://nodejs.dev/en/learn/how-to-install-nodejs/) installed.
Install the dependencies with `npm install && git submodule update --init --force --recursive`, you should then be able
to run the tests using `forge test` or deploy a new registry using `forge script Deploy` (and the correct arguments, based on the chain and key you want to use - see the [Foundry docs](https://book.getfoundry.sh/)).

## Use-case
This registry allows frontend to easily and trustlessly query the deployer behind a given delegate. This might then used to assume a delegate as "safe" or not, based on front-end opinion.

## Risks & trade-off
A nasty delegate has a mint privilege access. It is therefore a key responsability to front-end providing informations to project owners and users on unintended/potentially adversarial behaviour, especially for unknow delegates.
npm package: @jbx-protocol/juice-v1-token-terminal
Description: Allows project owners to specify the v1 project token that they are willing to accept from holders in exchange for their v2 project token.
Latest version: 1.0.1

# Juicebox v1 Token Terminal

Allows project owners to specify the v1 project token that they are willing to accept from holders in exchange for their v2 project token.

# Install Foundry

To get set up:

1. Install [Foundry](https://github.com/gakonst/foundry).

```bash
curl -L https://foundry.paradigm.xyz | sh
```

2. Install external lib(s)

```bash
git submodule update --init && yarn install
```

then run

```bash
forge update
```

If git modules are failing to clone, not installing, etc (ie overall submodule misbehaving), use `git submodule update --init --recursive --force`

3. Run tests:

```bash
forge test
```

4. Update Foundry periodically:

```bash
foundryup
```

# Deploy & verify

#### Setup

Configure the .env variables, and add a mnemonic.txt file with the mnemonic of the deployer wallet. The sender address in the .env must correspond to the mnemonic account.

## Rinkeby

```bash
yarn deploy-rinkeby
```

## Mainnet

```bash
yarn deploy-mainnet
```

The deployments are stored in ./broadcast

See the [Foundry Book for available options](https://book.getfoundry.sh/reference/forge/forge-create.html).
npm package: @jbx-protocol/project-handles
Description: The JBProjectHandles contract manages reverse records that point from JB project IDs to ENS nodes. If the reverse record of a project ID is pointed to an ENS node with a TXT record matching the ID of that project, then the ENS node will be considered the 
Latest version: 2.0.5

# Juicebox Project Handles

The JBProjectHandles contract manages reverse records that point from JB project IDs to ENS nodes. If the reverse record of a project ID is pointed to an ENS node with a TXT record matching the ID of that project, then the ENS node will be considered the "handle" for that project.

# Install Foundry

To get set up:

1. Install [Foundry](https://github.com/gakonst/foundry).

```bash
curl -L https://foundry.paradigm.xyz | sh
```

2. Install external lib(s)

```bash
git submodule update --init && yarn install
```

then run

```bash
forge update
```

3. Run tests:

```bash
forge test
```

4. Update Foundry periodically:

```bash
foundryup
```

# Deploy & verify

Using the solidity script after configuring the .env accordingly (the sender address must be corresponding to the private key)

See the [Foundry Book for available options](https://book.getfoundry.sh/reference/forge/forge-create.html)

## Goerli

```bash
yarn deploy-goerli
```

## Mainnet

```bash
yarn deploy-mainnet
```

The deployments are stored in ./broadcast
npm package: @jbx-protocol/ve-nft
Description: Issue an NFT that represents a locked position of juicebox project tokens (unclaimed or as ERC20s).
Latest version: 0.0.7

# VE NFT

Issue an NFT that represents a locked position of juicebox project tokens (unclaimed or as ERC20s).

# Install Foundry

To get set up:

1. Install [Foundry](https://github.com/gakonst/foundry).

```bash
curl -L https://foundry.paradigm.xyz | sh
```

2. Install external lib(s)

```bash
git submodule update --init && yarn install
```

then run

```bash
forge update
```

If git modules are failing to clone, not installing, etc (ie overall submodule misbehaving), use `git submodule update --init --recursive --force`

3. Run tests:

```bash
forge test
```

4. Update Foundry periodically:

```bash
foundryup
```

## Content

This repo is organised as follow:

- contracts/Allocator: contains an IJBSplitsAllocator implementation template (Allocator.sol)

- contracts/DatasourceDelegate: contains an IJBFundingCycleDataSource, IJBPayDelegate and IJBRedemptionDelegate implementation templates (DataSourceDelegate.sol).

- contracts/Terminal: contains an IJBPaymentTerminal and IJBRedemptionTerminal implementation template.

# Deploy & verify

#### Setup

Configure the .env variables, and add a mnemonic.txt file with the mnemonic of the deployer wallet. The sender address in the .env must correspond to the mnemonic account.

## Rinkeby

```bash
yarn deploy-rinkeby
```

## Mainnet

```bash
yarn deploy-mainnet
```

The deployments are stored in ./broadcast

See the [Foundry Book for available options](https://book.getfoundry.sh/reference/forge/forge-create.html).
npm package: @jbyerline/homebridge-purple-powerbase
Description: HomeKit Purple Powerbase connector. Requires use of additional Flask server
Author: jbyerline
Latest version: 2.2.6

# homebridge-purple-powerbase

Simple HTTP Homebridge plugin for the Reverie Purple Powerbase
_________________________________________

## Installation
Please read through the README for the Python Flask API that is required for this plugin to work:  [here](https://github.com/jbyerline/flask-purple-powerbase).

Once that is completed you can update your config file to match the pattern below.

## Device Configuration
```
{
    "accessory": "Purple Powerbase",
    "name": "Purple Powerbase",
    "base_url": "http://10.0.0.214:8000",
    "led_type": "bluetooth"
}
```

## Configuration Params
|             Parameter            |                       Description                       | Required |
| -------------------------------- | ------------------------------------------------------- |:--------:|
| `accessory`                      | name of the plugin (must be Purple Powerbase)           |     ✓    |
| `name`                           | name of the accessory in Home app                       |     ✓    |
| `base_url`                       | url endpoint for whatever is receiving these requests   |     ✓    |
| `led_type`                       | bluetooth or GPIO                                       |     ✓    |


## Help
- Make sure specify a port (probably 8000). (i.e. `"base_url" : "http://192.168.X.XXX:8000"`)
npm package: @jc-jacobe/react-kit
Description: A CLI Tool to Create a React + Vite Pre-Setup Application
Author: John Carlo Pura Jacobe
Latest version: 1.0.6

# ⚡ Welcome to React Kit by John Carlo P. Jacobe!

### A **starter template** for building modern React applications, powered by **Vite**. It comes with a clean, **module-based folder structure** and pre-installed tools to help you move faster.

---

## ✨ Features

- ⚛️ **React + Vite** — Fast, modern React setup
- 🎨 **Tailwind CSS** — Utility-first styling
- 🧩 **ShadCN/UI** — Ready-to-use UI components
- 🔗 **React Router DOM** — Client-side routing
- 📦 **Axios** — Simplified HTTP requests
- 🔣 **React Icons** — Popular icon library included
- 🗂️ **Module-based folder structure** — Scalable architecture out of the box

---

## 🚀 Getting Started

### You can create a new project directly from this template using **NPX**:

### 1. Create a new project

- This will create a new folder called `my-app` with everything set up.

```console
$ npx @jc-jacobe/react-kit my-app
```

or

- If you want to install in the current folder, use:

```console
$ npx @jc-jacobe/react-kit .
```

### 2. Navigate into the project if you provide folder name.

```console
$ cd my-app
```

### 3. Start the development

```console
$ npm run dev
```

# ⚠️ Notes

- If you run the command in an existing folder (e.g., ./), make sure it’s empty before generating the project, otherwise you may get errors.
- Requires `Node.js v16+`.

# 🛠️ Author

- Created and Vibe Coded with ❤️ by John Carlo P. Jacobe
npm package: @jc-org/generator-ozark
Description: >
Author: Jacky
Latest version: 1.1.3

# generator-ozark

## Installation

First, install [Yeoman](http://yeoman.io) and generator-yo-demo-1 using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).

```bash
npm install -g yo
```

Then generate your new project:

```bash
yarn add -D @jc-org/generator-ozark
yo @jc-org/generator-ozark
```

## Getting To Know Yeoman

- Yeoman has a heart of gold.
- Yeoman is a person with feelings and opinions, but is very easy to work with.
- Yeoman can be too opinionated at times but is easily convinced not to be.
- Feel free to [learn more about Yeoman](http://yeoman.io/).

## License

MIT © [Jacky]()

[npm-image]: https://badge.fury.io/js/generator-yo-demo-1.svg
[npm-url]: https://npmjs.org/package/generator-yo-demo-1
[travis-image]: https://travis-ci.com//generator-yo-demo-1.svg?branch=master
[travis-url]: https://travis-ci.com//generator-yo-demo-1
[daviddm-image]: https://david-dm.org//generator-yo-demo-1.svg?theme=shields.io
[daviddm-url]: https://david-dm.org//generator-yo-demo-1
[coveralls-image]: https://coveralls.io/repos//generator-yo-demo-1/badge.svg
[coveralls-url]: https://coveralls.io/r//generator-yo-demo-1
npm package: @jc-utils/amount
Description: 金额工具库
Latest version: 1.3.1

# 金额工具类库

## 安装
```bash
npm install @js-utils/amount --save
```

## 依赖
```json
{
    "decimal.js": "^10.4.3",
    "lodash-es": "^4.17.21"
}
```

## 接口说明

### 金额计算

#### 金额相加

```typescript
add(0.1, 0.2); // 0.3
```

#### 金额相减

```typescript
sub(0.3, 0.2); // 0.1
```

#### 金额相乘

```typescript
mul(0.1, 0.2); // 0.02
```

#### 金额相除

```typescript
div(0.2, 2); // 0.1
```

### 元角分转换

#### 分转换为元
```typescript
centToYuan(100); // 1
```
#### 元转换为分

```typescript
yuanToCent(1); // 100
```

### 金额转换为中文

```typescript
convertToChinese("12.34"); // 壹拾贰元叁角肆分
convertToChinese(12.34); // 壹拾贰元叁角肆分
```

### 金额域输入限制
用于处理输入域的input事件，限制用户的输入内容

```typescript
limitAmountInput('12.334'); // 12.33
```
npm package: @jc21/cypress-jwt-creation
Description: Generate a JWT for use your tests
Author: Jamie Curnow
Latest version: 0.0.6

# Cypress JWT Creation

Create JWT tokens with ease

[![npm (scoped)](https://img.shields.io/npm/v/@jc21/cypress-jwt-creation.svg?style=for-the-badge)](https://www.npmjs.com/package/@jc21/cypress-jwt-creation)
[![npm (types)](https://img.shields.io/npm/types/@jc21/cypress-jwt-creation.svg?style=for-the-badge)](https://www.npmjs.com/package/@jc21/cypress-jwt-creation)
[![npm (licence)](https://img.shields.io/npm/l/@jc21/cypress-jwt-creation.svg?style=for-the-badge)](https://www.npmjs.com/package/@jc21/cypress-jwt-creation)


### Cypress Installation

```bash
yarn add @jc21/cypress-jwt-creation
```

Then in your cypress Plugins file:
```javascript
const {JwtCreation} = require('@jc21/cypress-jwt-creation');

module.exports = (on, config) => {
    // ...
    on('task', JwtCreation(config));
    // ...
    return config;
};
```


### Cypress Usage

```javascript
describe('Hit an authenticated endpoint', () => {
    it('Should be able to get a response', async function () {
        cy.request('/users/me').then($response => {

            const token = await cy.task('generateToken', {
                privateKey: '/path/to/private.key',
                issuer:     'cypress-tester',
                algo:       'RS256',
                expires:    '1 day',
                claims:     {
                    capabilities: 'superuser'
                }
            });

            // use token in your requests
        });
    });
});
```

### The Private Key

Due to the fact that this plugin runs on the Cypress Backend, the location of the private key file must be defined as either
the full path on disk or relative path to the running of the cypress command. You can define the file location
either with an environment variable which can apply to all tests:

`config.env.jwtPrivateKey`

or within each individial test using the options below. In addition, you can also define the JWT algorithm if different from
the default `RS256` with:

`config.env.jwtAlgo`


### Options

| Option       | Description                                                   | Optional | Default                         |
| ------------ | ------------------------------------------------------------- | -------- | ------------------------------- |
| `privateKey` | The location of the private key file                          | true     | `config.env.jwtPrivateKey`      |
| `issuer`     | Issuer string                                                 | true     | "cypress.testing"               |
| `algo`       | The request method of the endpoint                            | true     | `config.env.jwtAlgo` or `RS256` |
| `expires`    | English interval of token expiry                              | true     | "1 day"                         |
| `claims`     | An object of extra claims you might want to set               | true     | {}                              |


### Compiling Source

```bash
yarn install
yarn build
yarn test
```
npm package: @jc21/messageformat-convert
Description: Convert input (e.g. from Rails i18n) into messageformat-compatible JSON
Author: Eemeli Aro
Latest version: 0.2.0

# messageformat-convert

Converts hiearachical objects into [messageformat]-compatible JSON. More
specifically, it:

- Detects two-letter locale keys and parses their contents according to that
  locale's pluralisation rules
- Converts `#{var}` and `%{var}` variable replacements into their messageformat
  equivalents, while properly escaping other `{}` characters.
- Detects objects encoding pluralisation choices (using the locale-specific set
  of CLDR categories, i.e. `zero|one|two|few|many|aother`) and converts them to
  their messageformat equivalents.

With these conversions, messages stored according to the Rails i18n spec may be
used together with [messageformat].

### Installation

```sh
npm install messageformat-convert
```

If using in an environment that does not natively support ES6 features such as
object destructuring and arrow functions, you'll want to use a transpiler for this.

### Usage

```js
const convert = require('messageformat-convert');
const { locales, translations } = convert({
  en: {
    format: '%{attribute} %{message}',
    errors: {
      confirmation: "doesn't match %{attribute}",
      accepted: 'must be accepted',
      wrong_length: {
        one: 'is the wrong length (should be 1 character)',
        other: 'is the wrong length (should be %{count} characters)'
      },
      equal_to: 'must be equal to %{count}'
    }
  }
});

const MessageFormat = require('messageformat');
const mf = new MessageFormat(locales);
const messages = mf.compile(translations);

messages.en.errors.accepted();
// 'must be accepted'

messages.en.format({
  attribute: 'Problem',
  message: messages.en.errors.confirmation({ attribute: 'your style' })
});
// 'Problem doesn\'t match your style'

messages.en.errors.wrong_length({ count: 42 });
// 'is the wrong length (should be 42 characters)'
```

### API: `convert(data, options)`

`data` should be a hierarchical object of strings; `options` is an optional set
of configuration:

- `defaultLocale` (string, default `'en'`) – Sets the initial locale.

- `includeLocales` (array of strings, default `null`) – By default any key in the
  input data that matches the two-letter code of a [CLDR pluralisation language]
  switches the language used for determining the pluralisation rules. Set this to
  some limited set of languages (or even an empty array) to limit that.

- `verbose` (boolean, default `false`) – If set to `true`, some logging and
  warnings will be printed to the console.

For more options, take a look at the [source](./index.js).

The object returned by the function contains the following fields:

- `locales` (array of strings) – The actual locales encountered in the data

- `translations` (object) – An object containing the MessageFormat strings,
  matching the shape of the input data

[cldr pluralisation language]: http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html
[messageformat]: https://messageformat.github.io/
npm package: @jc21/ntfy-client
Description: Send notifications over ntfy.sh
Author: Jamie Curnow
Latest version: 1.0.0

# Ntfy Client

Send notifications to your devices using Ntfy.

This is a singular package fork of [ffflorian/node-packages](https://github.com/ffflorian/node-packages/tree/main/packages/ntfy), and includes a fix for
using Token authorization, a bug with v1.14.0 of the [ntfy](https://www.npmjs.com/package/ntfy) npmjs package.

[![npm (scoped)](https://img.shields.io/npm/v/@jc21/ntfy-client.svg?style=for-the-badge)](https://www.npmjs.com/package/@jc21/ntfy-client)
[![npm (types)](https://img.shields.io/npm/types/@jc21/ntfy-client.svg?style=for-the-badge)](https://www.npmjs.com/package/@jc21/ntfy-client)
[![npm (licence)](https://img.shields.io/npm/l/@jc21/ntfy-client.svg?style=for-the-badge)](https://www.npmjs.com/package/@jc21/ntfy-client)


### Install

```bash
yarn add @jc21/ntfy-client
```

## Usage

### Simple example

```ts
import {publish} from '@jc21/ntfy-client';

await publish({
  message: 'This is an example message.',
  topic: 'mytopic',
});
```

### Advanced example

```ts
import {publish, MessagePriority} from '@jc21/ntfy-client';

await publish({
  actions: [
    {
      clear: true,
      extras: {
        cmd: 'pic',
        camera: 'front',
      },
      intent: 'io.heckel.ntfy.USER_ACTION',
      label: 'Take picture',
      type: 'broadcast',
    },
    {
      body: '{"action": "close"}',
      clear: false,
      headers: {
        Authorization: 'Bearer zAzsx1sk..',
      },
      label: 'Close door',
      method: 'PUT',
      type: 'http',
      url: 'https://api.mygarage.lan',
    },
    {
      clear: true,
      label: 'Open portal',
      type: 'view',
      url: 'https://api.nest.com/',
    },
  ],
  authorization: {
    password: 'my-password',
    username: 'my-username',
  },
  // Or:
  // authorization: 'my-token,
  clickURL: 'https://github.com/ffflorian/',
  delay: '1m',
  disableCache: true,
  disableFirebase: true,
  emailAddress: 'name@example.com',
  iconURL: 'https://avatars.githubusercontent.com/ffflorian',
  message: 'Remote access to device detected. Act right away.',
  priority: MessagePriority.MAX,
  server: 'https://ntfy.custom',
  tags: ['warning', 'skull'],
  title: 'Unauthorized access detected',
  topic: 'mytopic',
});
```

### Use a custom server without specifying it every time

```ts
import {NtfyClient} from '@jc21/ntfy-client';
const ntfyClient = new NtfyClient('https://ntfy.custom');

await ntfyClient.publish({ ... });
await ntfyClient.publish({ ... });
```


### Compiling Source

```bash
yarn install
yarn build
yarn test
```
npm package: @jc21/nzbget-jsonrpc-api
Description: An API Client for NzbGet JSONRPC
Author: Jamie Curnow
Latest version: 1.0.0

# NzbGet JSONRPC API Client

See: https://nzbget.net/api/

This client is designed for NZBGet v18+


### Usage

```javascript
const NzbGet = require('@jc21/nzbget-jsonrpc-api').Client;

let ng = new NzbGet('http://username:password@localhost:6789/jsonrpc');

// Using the helper method:
ng.listgroups()
    .then(groups => {
        console.log(groups);
    })
    .catch(err => {
        console.error('ERR:', err);
    });

// Or using the custom call method:
ng.call('listgroups')
    .then(groups => {
        console.log(result);
    })
    .catch(err => {
        console.error('ERR:', err);
    });
```


#### Helper Methods

These methods have the same method signature as the [API Documentation](https://nzbget.net/api/)

- `ng.version()`
- `ng.shutdown()`
- `ng.reload()`
- `ng.listgroups()`
- `ng.listfiles()`
- `ng.history()`
- `ng.append()`
- `ng.editqueue()`
- `ng.scan()`
- `ng.status()`
- `ng.getlog()`
- `ng.writelog()`
- `ng.loadlog()`
- `ng.servervolumes()`
- `ng.resetservervolume()`
- `ng.rate()`
- `ng.pausedownload()`
- `ng.resumedownload()`
- `ng.pausepost()`
- `ng.resumepost()`
- `ng.pausescan()`
- `ng.resumescan()`
- `ng.scheduleresume()`
- `ng.config()`
- `ng.loadconfig()`
- `ng.saveconfig()`
- `ng.configtemplates()`


### Compiling

```bash
npm install
tsc --project tsconfig.build.json
```
npm package: @jc21/radarr-api
Description: An API Client for Radarr
Author: Jamie Curnow
Latest version: 0.1.1

# Radarr API Client

See: https://github.com/Radarr/Radarr/wiki/API

### Usage

```javascript
const Radarr = require('@jc21/radarr-api').Radarr;

let r = new Radarr('https://USER:PASS8@radarr.example.com', 'APIKEY');

r.movies()
    .then(result => {
        console.log(result);
    })
    .catch(err => {
        console.error('ERR:', err);
    });
```


### Compiling

```bash
npm install
tsc --project tsconfig.build.json
```
npm package: @jc21/slack-hawk-down
Description: Render Slack flavored markdown as HTML
Author: Alec Hoey
Latest version: 0.5.2

# <img src="slack_hawk_down.png" width="100px" /> Slack Hawk Down

Slack-flavored markdown as HTML

## Installation
```
npm install --save @jc21/slack-hawk-down
```

## Usage

### Render universal Slack markdown as HTML
```
import { escapeForSlack, escapeForSlackWithMarkdown } from '@jc21/slack-hawk-down'

escapeForSlack(':wave:') // => '&#1168;'
escapeForSlackWithMarkdown('`this is a code block`) // => '<span class="slack_code">this is a code block</span>'
```

You can view the rest of the markdown styles [here](https://get.slack.help/hc/en-us/articles/202288908-Format-your-messages)

### Replace Slack user IDs with user names

```
escapeForSlack('<@U123|david> did you see my pull request?', { users: { 'U123': 'david', ... } }) // => '@david did you see my pull request?'
```
You can get a list of the users in your Slack team by requesting [this endpoint](https://api.slack.com/methods/users.list) with a `users:read` scope

### Replace Slack channel IDs with channel names

```
escapeForSlack('<#C123> please fill out this poll', { channels : { '#C123': 'general', ... } }) // => '#general please fill out this poll'
```
You can get a list of the users in your Slack team by requesting [this endpoint](https://api.slack.com/methods/channels.list) with a `channels:read` scope

### Replace Custom Slack emojis

```
escapeForSlack(':facepalm:', { customEmoji: { facepalm: 'http://emojis.slackmojis.com/emojis/images/1450319441/51/facepalm.png', ... } }) // => '<img alt="facepalm" src="http://emojis.slackmojis.com/emojis/images/1450319441/51/facepalm.png" />'
```
You can get a list of custom emoji for your Slack team by requesting [this endpoint](https://api.slack.com/methods/emoji.list) with a `emoji:read` scope

### Replace subteam names (for paid accounts)
```
escapeForSlack('<!subteam^S123>', { usergroups: { 'S123': 'swiftype-eng', ...} }) // => 'swiftype-eng'
```
You can get a list of user groups for your Slack team by requesting [this endpoint](https://api.slack.com/methods/usergroups.list) with a `usergroups:read` scope

## Testing

```
npm test
```

## Upcoming
- Customizeable element and class names for markdown elements

## Contribution
Please open a pull request or issue

## License
MIT
npm package: @jc21/sonarr-api
Description: An API Client for Sonarr
Author: Jamie Curnow
Latest version: 0.1.1

# Sonarr API Client

See: https://github.com/Sonarr/Sonarr/wiki/API

### Usage

```javascript
const Sonarr = require('@jc21/sonarr-api').Sonarr;

let s = new Sonarr('https://USER:PASS8@sonarr.example.com', 'APIKEY');

s.shows()
    .then(result => {
        console.log(result);
    })
    .catch(err => {
        console.error('ERR:', err);
    });
```


### Compiling

```bash
npm install
tsc --project tsconfig.build.json
```
npm package: @jc930221/platzom
Description: Traductor de idioma Platzom
Author: Julio Jaramillo
Latest version: 0.1.0

#Platzom
Platzom es un idioma inventado para el curso de fundamentos de JavaScript
##Descripcion del idioma.
- Si la palabra termina con "ar", se le quitan esas dos letras
- Si la palabra inicia con Z, se le añade "pe" al final
- Si la palabra traducida tiene 10 o más letras, se debe partir en dos por la mitad y unir con un guión medio
- Por último, si la palabra original es un palíndromo, ninguna regla anterior cuenta y se devuelve la misma palabra pero intercalando letras mayúsculas y minúsculas
##Instalación.
```
    npm install platzom

```
#Uso.
```
import platzom from 'platzom'

platzom("Programar") // Program
platzom("Zorro") // Zorrope
platzom("Zarpar") // Zarppe
platzom("abecedario") // abece-dario
platzom("sometemos") // SoMeTeMoS

```

#Creditos.
- [Julio Jaramillo](https://twitter.com/cesar9321)


## Licencia
[MIT](https://opensource.org/licenses/MIT)