open-index/open-npm huggingface dataset:
npm package: @mohayonao/ableton-live-utils
Description: utility functions
Author: mohayonao
Latest version: 0.3.0

# ABLETON LIVE UTILS
[![Build Status](http://img.shields.io/travis/mohayonao/ableton-live-utils.svg?style=flat-square)](https://travis-ci.org/mohayonao/ableton-live-utils)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/ableton-live-utils.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/ableton-live-utils)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> utility functions

## Installation

```sh
npm install @mohayonao/ableton-live-utils
```

## License

MIT
npm package: @mohayonao/append-if-not-exists
Description: append if not exists
Author: mohayonao
Latest version: 1.0.0

# append-if-not-exists
[![Build Status](http://img.shields.io/travis/mohayonao/append-if-not-exists.svg?style=flat-square)](https://travis-ci.org/mohayonao/append-if-not-exists)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/append-if-not-exists.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/append-if-not-exists)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> append if not exists

## Installation

```
npm install @mohayonao/append-if-not-exists
```

## API
- `appendIfNotExists(array: any[], target: any): boolean`
  - append `target` if not exists in `array`
  - return true if appended

## Example

```js
import appendIfNotExists from "@mohayonao/append-if-not-exists";

let array = [ 1, 2, 3, 4, 5 ];

console.log(appendIfNotExists(array, 6)); // true
console.log(array); // [ 1, 2, 3, 4, 5, 6 ]

console.log(appendIfNotExists(array, 3)); // false
console.log(array); // [ 1, 2, 3, 4, 5, 6 ]
```

## License
MIT
npm package: @mohayonao/chord
Description: chord
Author: Nao Yonamine
Latest version: 0.9.0

# chord
[![Build Status](http://img.shields.io/travis/mohayonao/chord.svg?style=flat-square)](https://travis-ci.org/mohayonao/chord)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/chord.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/chord)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

## Installation

```sh
npm install @mohayonao/chord
```

## Usage

```js
const chord = require("@mohayonao/chord");

// list of defined chord
console.log(Object.keys(chord));

// get chord
console.log(chord["major"]);
// → [ 0, 4, 7 ]
```

## License

MIT
npm package: @mohayonao/cross-fade-node
Description: cross fade for WebAudioAPI
Author: mohayonao
Latest version: 0.1.0

# CROSS FADE NODE
[![Build Status](http://img.shields.io/travis/mohayonao/cross-fade-node.svg?style=flat-square)](https://travis-ci.org/mohayonao/cross-fade-node)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/cross-fade-node.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/cross-fade-node)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> CrossFade for Web Audio API

## Installation

Node.js

```sh
npm install @mohayonao/cross-fade-node
```

## License
MIT
npm package: @mohayonao/defaults
Description: default value
Author: mohayonao
Latest version: 1.0.0

# DEFAULTS
[![Build Status](http://img.shields.io/travis/mohayonao/defaults.svg?style=flat-square)](https://travis-ci.org/mohayonao/defaults)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/defaults.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/defaults)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> default value

## Installation

```
npm install @mohayonao/defaults
```

## API
- `defaults(value: any, defaultValue: any): any`
  - return `defaultValue` if `value` is undefined

## Example

```js
import defaults from "@mohayonao/defaults";

console.log(defaults(null, 100)); // => null
console.log(defaults(undefined, 100)); // => 100
```

## License
MIT
npm package: @mohayonao/dispatcher
Description: simple dispatcher
Author: mohayonao
Latest version: 0.3.1

# DISPATCHER
[![Build Status](http://img.shields.io/travis/mohayonao/dispatcher.svg?style=flat-square)](https://travis-ci.org/mohayonao/dispatcher)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/dispatcher.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/dispatcher)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> simple dispatcher

## Installation

Node.js

```sh
npm install @mohayonao/dispatcher
```

## API
### Dispatcher
- `constructor()`

#### Instance methods
- `register(address: string, subscription: function): void`
- `register(subscription: function): void`
- `register({ delegate: function }): void`
- `unregister(address: string, subscription: function): void`
- `unregister(subscription: function): void`
- `unregister({ delegate: function }): void`
- `dispatch(address: string, data: any): void`

### Dispatcher.Delegator
- `constructor()`

#### Instance methods
- `delegate(address: string, data: any): void`

### Dispatcher.Duplex
- `constructor()`

## Messaging Protocol
```
+--------+                  +-------------+
| source | <-- register --- | destination |
|        | --- dispatch --> |             |
+--------+                  +-------------+

interface souce {
  register(address: string, subscription: function): void;
  register(subscription: function): void;
  register({ delegate: function }): void;
  dispatch(address: string, data: any): void;
}

interface destination {
  delegate(address: string, data: any): void;
}
```

`address: string` must start with "/".

```js
let publisher = new Dispatcher();
let subscriber = new Dispatcher.Delegator();

// define action of address
subscriber["/message/view"] = (message) => {
  console.log(`received: ${message}`);
};

publisher.register(subscriber);

publisher.dispatch("/message/view", "hello!");
// -> call subscriber.delegate("/message/view", "hello!")
// => "received: hello!"
```

## License
MIT
npm package: @mohayonao/envelope
Description: simple envelope
Author: mohayonao
Latest version: 0.1.4

# ENVELOPE
[![Build Status](http://img.shields.io/travis/mohayonao/envelope.svg?style=flat-square)](https://travis-ci.org/mohayonao/envelope)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/envelope.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/envelope)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> simple envelope

## Installation

Node.js

```sh
npm install @mohayonao/envelope
```

Browser

- [envelope.js](https://raw.githubusercontent.com/mohayonao/envelope/master/build/envelope.js)

## API
### Envelope
- `constructor(params: [ time: number, value: number, curve: number ][])`

### Class methods
- `adssr(attackTime, decayTime, sustainLevel, sustainTime, releaseTime, [ totalLevel = 1 ]): Envelope`
- `ads(attackTime, decayTime, sustainLevel, [ totalLevel = 1 ]): Envelope`
- `asr(attackTime, sustainTime, releaseTime, [ totalLevel = 1 ]): Envelope`
- `a(attackTime, [ totalLevel = 1 ]): Envelope`
- `dssr(decayTime, sustainLevel, sustainTime, releaseTime, [ totalLevel = 1 ]): Envelope`
- `ds(decayTime, sustainLevel, [ totalLevel = 1 ]): Envelope`
- `r(releaseTime, [ totalLevel = 1 ]): Envelope`
- `cutoff(releaseTime, [ totalLevel = 1 ]): Envelope`

### Instance attribute
- `params: [ number, number, number ][]`
- `duration: number`

### Instance methods
- `valueAt(time: number): number`
- `applyTo(audioParam: AudioParam, playbackTime: number): self`
- `map(fn: function): Envelope`
- `madd(mul: number, add: number = 1): Envelope`

## License
MIT
npm package: @mohayonao/eq
Description: eq
Author: mohayonao
Latest version: 0.1.0

# EQ
[![Build Status](http://img.shields.io/travis/mohayonao/eq.svg?style=flat-square)](https://travis-ci.org/mohayonao/eq)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/eq.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/eq)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> EQ

## Installation

Node.js

```sh
npm install @mohayonao/eq
```

## API
### EQ
- `constructor(audioContext: AudioContext, paramsList: object[]): AudioNode`

#### Instance attributes
- `filters: BiquadFilter[]`

#### Instance methods
- `connect(...args): void`
- `disconnect(...args): void`

## Examples

```js
import EQ from "@mohayonao/eq";

let eq = new EQ(audioContext, [
  { frequency: 400, Q: 10, gain: 20 },
  { frequency: 800, Q: 20, gain: 40 },
  { frequency: 1200, Q: 15, gain: 30 },
  { type: "lpf", frequency: 200, Q: 0.8 },
  { type: "hpf", frequency: 3200, Q: 0.8 },
]);

bufSrc.connect(eq);
eq.connect(audioContext.destination);
```

## License
MIT
npm package: @mohayonao/event-emitter
Description: tiny event emitter
Author: mohayonao
Latest version: 1.0.1

# EVENT EMITTER
[![Build Status](http://img.shields.io/travis/mohayonao/event-emitter.svg?style=flat-square)](https://travis-ci.org/mohayonao/event-emitter)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/event-emitter.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/event-emitter)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> tiny event emitter

## Installation

Node.js

```sh
npm install @mohayonao/event-emitter
```

## API
### EventEmitter
- `constructor()`

### Instance methods
- `listeners(event: string): function[]`
- `addListener(event: string, listener: function): self`
- `on(event: string, listener: function): self`
- `once(event: string, listener: function): self`
- `removeListener(event: string, listener: function): self`
- `removeAllListeners([ event: string ]): self`
- `emit(event: string, arg1: any): self`

## License
MIT
npm package: @mohayonao/feedback-delay
Description: Feedback Delay for Web Audio API
Author: mohayonao
Latest version: 0.1.0

# FEEDBACK DELAY
[![Build Status](http://img.shields.io/travis/mohayonao/feedback-delay.svg?style=flat-square)](https://travis-ci.org/mohayonao/feedback-delay)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/feedback-delay.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/feedback-delay)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> Feedback Delay for Web Audio API

## API
### FeedbackDelay
- `constructor(audioContext: AudioContext, [maxDelayTime: numebr = 1])`

### Instance attributes
- `context: AudioContext`
- `delayTime: AudioParam`
- `feedback: AudioParam`

### Instance methods
- `connect(...args): void`
- `disconnect(...args): void`
- `dispose(): void`

## License
MIT
npm package: @mohayonao/fixed-stereo-panner-node
Description: FixedStereoPannerNode for Web Audio API
Author: mohayonao
Latest version: 0.1.0

# FIXED STEREO PANNER NODE
[![Build Status](http://img.shields.io/travis/mohayonao/fixed-stereo-panner-node.svg?style=flat-square)](https://travis-ci.org/mohayonao/fixed-stereo-panner-node)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/fixed-stereo-panner-node.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/fixed-stereo-panner-node)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> FixedStereoPannerNode for Web Audio API

## Installation

Node.js

```
npm install @mohayonao/fixed-stereo-panner-node
```

## Example

```js
import FixedStereoPannerNode from "@mohayonao/fixed-stereo-panner-node";

let audioContext = new AudioContext();
let oscillator = audioContext.createOscillator();
let panner = new FixedStereoPannerNode(audioContext, 0.5);

oscillator.start();

oscillator.connect(panner);
panner.connect(audioContext.destination);

setTimeout(() => {
  oscillator.stop();
  oscillator.disconnect();
  panner.disconnect();
}, 2000);
```

## API
- `constructor(audioContext: AudioContext, pan: number): ChannelSplitterNode`

### Instance attributes
- `context: AudioContext` _readonly_
- `pan: number` _readonly_

### Instance methods
- `connect(...args): void`
- `disconnect(...args): void`
- `dispose(): void`

## License
MIT
npm package: @mohayonao/fluxx
Description: simple implementation of Flux architecture
Author: mohayonao
Latest version: 0.1.2

# FLUXX
[![Build Status](http://img.shields.io/travis/mohayonao/fluxx.svg?style=flat-square)](https://travis-ci.org/mohayonao/fluxx)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/fluxx.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/fluxx)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> simple implementation of Flux architecture

## Installation

```
npm install @mohayonao/fluxx
```

## API
### Router
- `constructor()`

#### Instance attributes
- `actions: Action[]`
- `stores: Store[]`

#### Instance methods
_Also implements methods from the interface [@mohayonao/event-emitter](https://github.com/mohayonao/event-emitter)._

- `getStateFromStores(): object`
- `createAction(address: string, data: any): void`
- `addChangeListener(listener: function): void`
- `removeChangeListener(listener: function): void`

### Action
- `constructor(router: Router)`

#### Instance attributes
- `router: Router`

#### Instance methods
- `doneAction(address: string, data: any): void`

### Store
- `constructor(router: Router)`

#### Instance attributes
- `router: Router`
- `data: object`
- `name: string`

#### Instance methods
- `getInitialState(): object`
- `getState(): object`
- `emitChange(): void`

## LICENSE
MIT
npm package: @mohayonao/fm-synth
Description: simple frequency modulation synthesizer
Author: mohayonao
Latest version: 0.1.3

# FM SYNTH
[![Build Status](http://img.shields.io/travis/mohayonao/fm-synth.svg?style=flat-square)](https://travis-ci.org/mohayonao/fm-synth)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/fm-synth.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/fm-synth)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> simple frequency modulation synthesizer

## Installation

Node.js

```sh
npm install @mohayonao/fm-synth
```

Browser

- [fm-synth.js](https://raw.githubusercontent.com/mohayonao/fm-synth/master/build/fm-synth.js)

## API
### Operator
- `constructor(algorithm: number|string, operators: any[])`

#### Instance attribute
- `context: AudioContext`
- `operators: any[]`
- `algorithm: string`
- `onended: function`

#### Instance methods
- `connect(destination: AudioNode): void`
- `disconnect(): void`
- `start(when: number): void`
- `stop(when: number): void`

## Algorithm Notation
```js
let A = audioContext.createDelay();
let B = new Operator(audioContext);
let C = new Operator(audioContext);
let D = new Operator(audioContext);
let fm = new FMSynth("E-D-C->; B-A->", [ A, B, C, D, 0 ]);
```

- `A`, `B`, `C` ... `Z`: index of the operators
- `-`: connection (connects to a node's frequency or node self if not has frequency)
- `>`: connection to output
- `;`: separator
- `0` in operators mean OFF. Those are ignored in the audio graph.

Now, the instance of FMSynth builds the below graph by the given algorithm `"D-C->; B-A->"`.

![fm-synth](https://raw.githubusercontent.com/wiki/mohayonao/fm-synth/images/fm-synth.png)

## Algorithm Presets
![4 operators algorithm](https://raw.githubusercontent.com/wiki/mohayonao/fm-synth/images/4-op-alg.png)

## See Also
- [@mohayonao/operator](https://github.com/mohayonao/operator) - simple operator

## License
MIT
npm package: @mohayonao/frame-sequencer
Description: frame sequencer
Author: mohayonao
Latest version: 0.1.4

# FREAME SEQUENCER
[![Build Status](http://img.shields.io/travis/mohayonao/frame-sequencer.svg?style=flat-square)](https://travis-ci.org/mohayonao/frame-sequencer)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/frame-sequencer.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/frame-sequencer)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> frame sequencer

## API
### FrameSequencer
- `constructor()`

#### Instance methods
- `add(element: FrameElement): boolean`
- `remove(element: FrameElement): boolean`
- `removeAll(): void`
- `update(t0: number, t1: number = t0): void`
- `onResume(t0: number, t1: number): void`
- `onStartElement(element: FrameElement): void`
- `onStopElement(element: FrameElement): void`
- `onPause(t0: number, t1: number): void`

### FrameElement
- ` constructor(opts = {})`

#### Instance attributes
- `layer: number`
- `startTime: number`
- `stopTime: number`
- `data: object`

#### Instance methods
- `stateAtTime(time: number): string`
- `init(): void`
- `update(t0: number, t1: number): any[]`
- `dispose(): void`

## License
MIT
npm package: @mohayonao/launchcontrol-message-parser
Description: launchcontrol message parser
Author: Nao Yonamine
Latest version: 0.9.2

# launchcontrol-message-parser
[![Build Status](http://img.shields.io/travis/mohayonao/launchcontrol-message-parser.svg?style=flat-square)](https://travis-ci.org/mohayonao/launchcontrol-message-parser)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/launchcontrol-message-parser.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/launchcontrol-message-parser)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

## Installation

```sh
npm install @mohayonao/launchcontrol-message-parser
```

## Example

```js
const parser = require("@mohayonao/launchcontrol-message-parser");

launchControl.onmidimessage = (e) => {
  const items = parser.parse(e.data);
  // → { col: 0, row: 0, val: 100, ch: 0 }

  if (items.col === 0 && items.row === 0) {
    console.log(`knob1-0: ${ items.val }`);
  }
};
```

## Data Matrix

![data-matrix](data-matrix.png)

## License

MIT
npm package: @mohayonao/midi-keyboard
Description: JavaScript utility for MIDI keyboard
Author: Nao Yonamine
Latest version: 0.2.1

# MIDI KEYBOARD
[![Build Status](http://img.shields.io/travis/mohayonao/midi-keyboard.svg?style=flat-square)](https://travis-ci.org/mohayonao/midi-keyboard)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/midi-keyboard.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/midi-keyboard)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> JavaScript utility for MIDI keyboard

[![Keystation Mini 32](http://otononaru.appspot.com/cdn/git-hub/midi-keyboard/ks32.jpg)](http://m-audio.com/products/view/keystation-mini-32)

## Installation

Node.js

```sh
npm install @mohayonao/midi-keyboard
```

Browser

- [midi-keyboard.js](http://mohayonao.github.io/midi-keyboard/build/midi-keyboard.js)

## Examples

Online examples (using Web MIDI API)

- [dump messages from Keystation Mini 32](http://mohayonao.github.io/midi-keyboard./examples/dump.html)

Run example with Node.js (using [node-midi](https://github.com/justinlatimer/node-midi))

```
node examples/dump.js
```
## API
### MIDIKeyboard
- `constructor(deviceName: string = 'Keystation Mini 32')`

#### Class methods

- `requestDeviceNames(): Promise<{ inputs: string[], outputs: string[] }>`

#### Instance methods
_Also implements methods from the interface [@mohayonao/event-emitter](https://github.com/mohayonao/event-emitter)._

- `open(): Promise<[ input, output ]>`
- `close(): Promise<[ input, output ]>`

#### Events

- `message`
  - `dataType: string`
    - noteOn
    - noteOff
    - modulation
    - volume
    - pan
    - expression
    - sustain
    - pitchbend
  - `deviceName: string`
  - `channel: number` 0 - 15
  - `value: number` 0 - 127 ( control change )
  - `noteNumber: number` 0 - 127 ( noteOn / noteOff )
  - `velocity: number` 0 - 127 ( noteOn / noteOff )

## Usage

Node.js

```js
var MIDIKeyboard = require("@mohayonao/midi-keyboard");
```

Browser
```html
<script src="/path/to/midi-keyboard.js"></script>
```

Common

```js
var midiKey = new MIDIKeyboard("Keystation Mini 32");

midiKey.open();

midiKey.on("message", function(e) {
  console.log("dataType  : " + e.dataType);
  console.log("noteNumber: " + e.noteNumber);
  console.log("velocity  : " + e.velocity);
  console.log("value     : " + e.value);
  console.log("channel   : " + e.channel);
});  
```

## License
MIT
npm package: @mohayonao/mixer-gain-node
Description: MixerGainNode
Author: mohayonao
Latest version: 0.1.0

# MIXER GAIN NODE
[![Build Status](http://img.shields.io/travis/mohayonao/mixer-gain-node.svg?style=flat-square)](https://travis-ci.org/mohayonao/mixer-gain-node)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/mixer-gain-node.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/mixer-gain-node)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> MixerGainNode

## Installation

```sh
npm install @mohayonao/mixer-gain-node
```

## API
### MixerGainNode
- `constructor(audioContext: AudioContext, numberOfInputs: number = 2)`

### Instance attributes
- `context: AudioContext`

### Instance methods
- `getChannelGain(channel: number): AudioParam`
- `connect(...args): void`
- `disconnect(...args): void`
- `dispose(): void`

## Example

```js
import MixerGainNode from "@mohayonao/mixer-gain-node";

let audioContext = new AudioContext();
let oscillator1 = audioContext.createOscillator();
let oscillator2 = audioContext.createOscillator();
let oscillator3 = audioContext.createOscillator();
let mixer = new MixerGainNode(audioContext, 3);
let t0 = audioContext.currentTime;
let t1 = t0 + 5;

oscillator1.frequency.value = 440;
oscillator1.start(t0);
oscillator1.stop(t1);
oscillator1.connect(mixer, 0, 0);

oscillator2.frequency.value = 660;
oscillator2.start(t0);
oscillator2.stop(t1);
oscillator1.connect(mixer, 0, 1);

oscillator3.frequency.value = 880;
oscillator3.start(t0);
oscillator3.stop(t1);
oscillator1.connect(mixer, 0, 2);

mixer.getChannelGain(0).value = 0.1;
mixer.getChannelGain(1).value = 0.2;
mixer.getChannelGain(2).setValueAtTime(0, t0);
mixer.getChannelGain(2).linearRampToValueAtTime(0.5, t1);

mixer.connect(audioContext.destination);
```

## License
MIT
npm package: @mohayonao/operator
Description: simple operator
Author: mohayonao
Latest version: 0.1.4

# OPERATOR
[![Build Status](http://img.shields.io/travis/mohayonao/operator.svg?style=flat-square)](https://travis-ci.org/mohayonao/operator)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/operator.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/operator)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> simple operator

## Installation

Node.js

```sh
npm install @mohayonao/operator
```

Browser

- [operator.js](https://raw.githubusercontent.com/mohayonao/operator/master/build/operator.js)

## API
### Operator
- `constructor(audioContext: AudioContext)`

#### Instance attribute
- `context: AudioContext`
- `type: string`
- `frequency: AudioParam`
- `detune: AudioParam`
- `gain: AudioParam`
- `onended: function`

#### Instance methods
- `connect(destination: AudioNode): void`
- `disconnect(): void`
- `start(when: number): void`
- `stop(when: number): void`
- `setPeriodicWave(periodicWave: PeriodicWave): void`
- `setEnvelope(envelope: any, target: string = 'gain'): void`
- `getEnvelope(target: string = 'gain'): void`

## AudioGraph

![operator](https://raw.githubusercontent.com/wiki/mohayonao/operator/images/operator.png)

## See Also
- [@mohayonao/envelope](https://github.com/mohayonao/envelope) - simple envelope
- [@mohayonao/fm-synth](https://github.com/mohayonao/fm-synth) - simple frequency modulation synthesizer

## License
MIT
npm package: @mohayonao/perlin-noise
Description: simple 1d perlin noise generator
Author: mohayonao
Latest version: 0.2.0

# PERLIN NOISE
[![Build Status](http://img.shields.io/travis/mohayonao/perlin-noise.svg?style=flat-square)](https://travis-ci.org/mohayonao/perlin-noise)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/perlin-noise.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/perlin-noise)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> simple 1d perlin noise generator

## Installation

```
npm install @mohayonao/perlin-noise
```

## API
### PerlinNoise
- `constructor(rand: function = Math.random)`

#### Instance methods
- `noise(x: number): number`

## License
MIT
npm package: @mohayonao/power-audio-node
Description: enhance the connecting interface for custom AudioNode
Author: mohayonao
Latest version: 0.1.1

# POWER AUDIO NODE
[![Build Status](http://img.shields.io/travis/mohayonao/power-audio-node.svg?style=flat-square)](https://travis-ci.org/mohayonao/power-audio-node)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/power-audio-node.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/power-audio-node)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> enhance the connecting interface of AudioNode for custom AudioNode

## Installation

Node.js

```sh
npm install @mohayonao/power-audio-node
```

Browser

- [power-audio-node.js](https://raw.githubusercontent.com/mohayonao/power-audio-node/master/build/power-audio-node.js)

## Interface for CustomAudioNode
```js
interface CustomAudioNode {
  __connectFrom(source, output = 0, input = 0): void;
  __disconnectFrom(source, output = 0, input = 0): void;
}
```

## API

#### Module methods
- `use(): void`
- `unuse(): void`

## License
MIT
npm package: @mohayonao/randgen
Description: simple random generator
Author: mohayonao
Latest version: 0.2.0

# RANDGEN
[![Build Status](http://img.shields.io/travis/mohayonao/randgen.svg?style=flat-square)](https://travis-ci.org/mohayonao/randgen)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/randgen.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/randgen)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> simple random generator

## Installation

```
npm install @mohayonao/randgen
```

## API
### RandGen
- `constructor([ seed: number ])`

#### Instance attributes
- `random(): number`

## Examples

```js
import RandGen from "@mohayonao/randgen";

function sample(list, rand = Math.random) {
  return list[(rand() * list.length)|0];
}

let rand = new RandGen(123456789).random;
let list = [ 1, 2, 3, 4, 5 ];

console.log(sample(list, rand)); // 5
console.log(sample(list, rand)); // 3
console.log(sample(list, rand)); // 2
```

## License
MIT
npm package: @mohayonao/remote-fluxx
Description: simple implementation of Flux architecture via network
Author: mohayonao
Latest version: 0.1.3

# REMOTE FLUXX
[![Build Status](http://img.shields.io/travis/mohayonao/remote-fluxx.svg?style=flat-square)](https://travis-ci.org/mohayonao/remote-fluxx)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/remote-fluxx.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/remote-fluxx)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> simple implementation of Flux architecture via network

## Installation

```
npm install @mohayonao/remote-fluxx
```

## API
### Server
- `constructor(socket: Socket, namespace: string)`

#### Instance attributes
- `socket: Socket`
- `namespace: string`
- `clients: object[]`

#### Instance methods
- `sendAction(address: string, data: any):  void`

### Client
- `constructor(socket: Socket, namespace: string)`

#### Instance attributes
- `socket: Socket`
- `namespace: string`

#### Instance methods
- `sendAction(address: string, data: any):  void`

## LICENSE
MIT
npm package: @mohayonao/remove-if-exists
Description: remove if exists
Author: mohayonao
Latest version: 1.0.0

# remove-if-exists
[![Build Status](http://img.shields.io/travis/mohayonao/remove-if-exists.svg?style=flat-square)](https://travis-ci.org/mohayonao/remove-if-exists)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/remove-if-exists.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/remove-if-exists)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> remove if exists

## Installation

```
npm install @mohayonao/remove-if-exists
```

## API
- `removeIfExists(array: any[], target: any): boolean`
  - remove `target` if exists in `array`
  - return true if removed

## Example

```js
import removeIfExists from "@mohayonao/remove-if-exists";

let array = [ 1, 2, 3, 4, 5 ];

console.log(removeIfExists(array, 3)); // true
console.log(array); // [ 1, 2, 4, 5 ]

console.log(removeIfExists(array, 6)); // false
console.log(array); // [ 1, 2, 4, 5 ]
```

## License
MIT
npm package: @mohayonao/script-processor-rack
Description: ScriptProcessorRackNode for Web Audio API
Author: mohayonao
Latest version: 0.1.0

# SCRIPT PROCESSOR RACK
[![Build Status](http://img.shields.io/travis/mohayonao/script-processor-rack.svg?style=flat-square)](https://travis-ci.org/mohayonao/script-processor-rack)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/script-processor-rack.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/script-processor-rack)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> ScriptProcessorRackNode for Web Audio API

## Installation

Node.js

```
npm install @mohayonao/script-processor-rack
```

## Example

```js
import ScriptProcessorRack from "@mohayonao/script-processor-rack";
import fetchAudioBuffer from "@mohayonao/web-audio-utils/fetchAudioBuffer";
import Reduction from "./Reduction";

class OnePole {
  constructor(coef, bufferSize) {
    this.output = new Float32Array(bufferSize);
    this.b1 = coef;
    this.y1 = 0;
  }

  process(input) {
    let output = this.output;
    let y0, y1 = this.y1, b1 = this.b1;

    if (b1 >= 0) {
      for (let i = 0, imax = input.length; i < imax; ++i) {
        y0 = input[i];
        output[i] = y1 = y0 + b1 * (y1 - y0);
      }
    } else {
      for (let i = 0, imax = input.length; i < imax; ++i) {
        y0 = input[i];
        output[i] = y1 = y0 + b1 * (y1 + y0);
      }
    }

    this.y1 = y1;

    return output;
  }
}

let audioContext = new AudioContext();
let bufferSource = audioContext.createBufferSource();
let effector = new ScriptProcessorRack(audioContext, 512);

fetchAudioBuffer("./amen.wav", audioContext).then((audioBuffer) => {
  bufferSource.buffer = audioBuffer;
  bufferSource.start();

  effector.addProcessor(new OnePole(0.95, effector.bufferSize)::process);
  effector.addProcessor(new Reduction(0.8, effector.bufferSize)::process);

  bufferSource.connect(effector);
  effector.connect(audioContext.destination);

  setTimeout(() => {
    bufferSource.stop();
    bufferSource.disconnect();
    effector.disconnect();
  }, 1000);  
})
```

## API
- `constructor(audioContext: AudioContext, [ bufferSize: number ]): ScriptProcessorNode`

### Instance attributes
- `context: AudioContext` _readonly_
- `bufferSize: number` _readonly_

### Instance methods
- `addProcessor(func: function): void`
- `removeProcessor(func: function): void`
- `connect(...args): void`
- `disconnect(...args): void`
- `dispose(): void`

## License
MIT
npm package: @mohayonao/static-stereo-panner-node
Description: StaticStereoPannerNode
Author: mohayonao
Latest version: 0.1.0

# STATIC STEREO PANNER NODE
[![Build Status](http://img.shields.io/travis/mohayonao/static-stereo-panner-node.svg?style=flat-square)](https://travis-ci.org/mohayonao/static-stereo-panner-node)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/static-stereo-panner-node.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/static-stereo-panner-node)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> StaticStereoPannerNode

## Installation

```sh
npm install @mohayonao/static-stereo-panner-node
```

## License
MIT
npm package: @mohayonao/timeline
Description: simple timeline
Author: mohayonao
Latest version: 0.3.0

# TIMELINE
[![Build Status](http://img.shields.io/travis/mohayonao/timeline.svg?style=flat-square)](https://travis-ci.org/mohayonao/timeline)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/timeline.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/timeline)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> simple timeline

## Installation

```
npm install @mohayonao/timeline
```

## API
### Timeline

- `constructor(opts = {})`

### Instance attributes
- `context: object`
- `interval: number`
- `aheadTime: number`
- `timerAPI: object`
- `playbackTime: number`
- `currentTime: number`
- `state: string`
- `events: object[]`

### Instance methods
- `start([ callback: function ]): self`
- `stop([ reset: boolean ]): self`
- `insert(time: number, callback: function, [ args: any[] ]): number`
- `nextTick(time: number, callback: function, [ args: any[] ]): number`
- `remove(schedId: number): number`
- `removeAll(): void`

### Events
- `start`
- `stop`
- `process`
- `processed`

## License
MIT
npm package: @mohayonao/utils
Description: utility functions
Author: mohayonao
Latest version: 0.5.0

# UTILS
[![Build Status](http://img.shields.io/travis/mohayonao/utils.svg?style=flat-square)](https://travis-ci.org/mohayonao/utils)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/utils.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/utils)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> utility functions

## Installation

```sh
npm install @mohayonao/utils
```

## License

MIT
npm package: @mohayonao/virtual-midi-device
Description: Utils for Virtual MIDI Device
Author: Nao Yonamine
Latest version: 0.2.0

# Virtual MIDI Device
[![Build Status](https://img.shields.io/travis/mohayonao/virtual-midi-device.svg?style=flat-square)](https://travis-ci.org/mohayonao/virtual-midi-device)
[![NPM Version](https://img.shields.io/npm/v/@mohayonao/virtual-midi-device.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/virtual-midi-device)
[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> Utils for Virtual MIDI Device

:construction_worker: WIP

## Installation

```
$ npm install @mohayonao/virtual-midi-device
```

## License

MIT
npm package: @mohayonao/wave-tables
Description: wave tables
Author: mohayonao
Latest version: 0.2.0

http://chromium.googlecode.com/svn/trunk/samples/audio/wave-tables/


## Usage

```js
const { Bass } = require("@mohayonao/wave-tables");
```

or load individually

```js
const Bass = require("@mohayonao/wave-tables/Bass");
```
npm package: @mohayonao/web-audio-utils
Description: Utility functions for Web Audio API
Author: mohayonao
Latest version: 0.7.1

# WEB AUDIO UTILS
[![Build Status](http://img.shields.io/travis/mohayonao/web-audio-utils.svg?style=flat-square)](https://travis-ci.org/mohayonao/web-audio-utils)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/web-audio-utils.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/web-audio-utils)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> Utility functions for Web Audio API

## Installation

Node.js

```sh
npm install @mohayonao/web-audio-utils
```

## API

- `activateCustomAudioNode(): void`
- `activateMobileAutoPlay([ audioContext, callback ]): AudioContext`
- `activateWebAudioAPI([ AudioContext, callback ]): AudioContext`
- `createAudioBufferFromArray(array: Float32Array[], [ audioContext ]): AudioBuffer`
- `createPeriodicWave(wave: object, [ audioContext ]): PeriodicWave`
  - `wave: { real: Float32Array, imag: Float32Array}`
  - this function is for [wave-tables](https://github.com/mohayonao/wave-tables).
- `fetchAudioBuffer(path: string, [ audioContext ]): Promise<AudioBuffer>`
  - fetch && decode
- `getAudioContext(): AudioContext`
  - return an AudioContext as singleton
- `splitAudioBuffer(audioBuffer: AudioBuffer, n: number): AudioBuffer[]`

## License
MIT
npm package: @mohdmahmodi/p2p-net
Description: Zero-config P2P networking with end-to-end encryption. WebRTC + NaCl.
Author: Mohd Mahmodi
Latest version: 1.1.2

# @mohdmahmodi/p2p-net

[![npm](https://img.shields.io/npm/v/@mohdmahmodi/p2p-net.svg)](https://www.npmjs.com/package/@mohdmahmodi/p2p-net)
[![size](https://img.shields.io/bundlephobia/minzip/@mohdmahmodi/p2p-net)](https://bundlephobia.com/package/@mohdmahmodi/p2p-net)
[![downloads](https://img.shields.io/npm/dm/@mohdmahmodi/p2p-net.svg)](https://www.npmjs.com/package/@mohdmahmodi/p2p-net)
[![license](https://img.shields.io/npm/l/@mohdmahmodi/p2p-net.svg)](https://github.com/mohdmahmodi/p2p-net/blob/main/LICENSE)

Zero-configuration P2P networking with E2E encryption. Direct connections between browsers and Node.js.

## Install

```bash
npm install @mohdmahmodi/p2p-net
```

## Quick Start

```javascript
import { createNode } from "@mohdmahmodi/p2p-net";

const node = createNode();
await node.start();

// Your ID is your public key
console.log("My ID:", node.id);

// Connect & send encrypted data
node.connectToPeer("peer-id");
node.send("peer-id", new TextEncoder().encode("Hello P2P!"));

// Receive data
node.onData((data, peerId) => {
  console.log("Message:", new TextDecoder().decode(data));
});
```

## Features

- 🔐 **End-to-end encryption** (Ed25519/NaCl)
- 🌐 **NAT traversal** (WebRTC + relay fallback)
- ⚡ **Zero configuration**
- 📦 **167KB bundle**
- 🔧 **TypeScript native**

## Documentation

**[Full documentation at p2p-net.dev →](https://mohdmahmodi.github.io/p2p-net)**

## Quick Examples

### Browser

```javascript
const node = createNode({
  relayUrl: "wss://relay.example.com",
});
```

### File Transfer

```javascript
const file = await fileInput.files[0].arrayBuffer();
node.send(peerId, new Uint8Array(file));
```

### React Hook

```javascript
function useP2P() {
  const [node, setNode] = useState(null);
  useEffect(() => {
    const p2p = createNode();
    p2p.start().then(() => setNode(p2p));
    return () => p2p.stop();
  }, []);
  return node;
}
```

## Relay Server

```bash
npx @mohdmahmodi/p2p-net-relay
```

## License

MIT
npm package: @mohdnajwan/bmi-calculator
Description: BMI calculator that accepts metric and imperial units
Author: Najwan
Latest version: 1.0.2

# @mohdnajwan/bmi-calculator

![alt](https://img.shields.io/badge/npm-1.0.1-blue)

A BMI calculator that accept metric and imperial units

## Install
```javascript
$ npm install @mohdnajwan/bmi-calculator
```

## Import
```javascript
const { BMI } = require('@mohdnajwan/bmi-calculator')
```

## Usage
Metric units weight in kg and height in meter
```javascript
// BMI(weight, height)

const myBMI = BMI(52.2,1.72)
// => 17.2
```

Imperial units Weight in lbs and height in inch.
Just add 'imperial' in the parameter after height.
```javascript
// BMI(weight,height,unit)

const myBMI = BMI(114.64, 67.7, 'imperial')
// => 17.2
```
npm package: @mohib22kool/balance-service-lib
Description: A NestJS library providing balance queue and Redis update service
Latest version: 0.1.2

# Balance Service Library

A lightweight NestJS library that pushes balance update messages into a RabbitMQ queue named `BALANCE` and consumes them to update Redis keys in the form `userId:balance:{INR:10,USD:20}`.

## Features

- Class-based `BalanceService` with small, focused methods
- Uses `amqplib` for RabbitMQ and `ioredis` for Redis
- Easy to import as a linked package (`npm link` or local path)

## Getting Started

1. Install dependencies:
   ```bash
   npm install
   ```

2. Build the library:
   ```bash
   npm run build
   ```

3. In your NestJS application, add the library as a dependency. If you're developing locally, you can use `npm link` or a relative path in `package.json`:
   ```json
   "dependencies": {
     "balance-service-lib": "file:../az-omi-balance"
   }
   ```

4. Import the module and inject the service:
   ```ts
   import { Module } from '@nestjs/common';
   import { BalanceModule, BalanceService } from 'balance-service-lib';

   @Module({
     imports: [BalanceModule],
     providers: [],
   })
   export class AppModule {
     constructor(private readonly balance: BalanceService) {
       // ensure service is initialized by Nest
     }
   }
   ```

5. Use the service to push messages:
   ```ts
   this.balance.pushToQueue('1234', 'INR', -10);
   ```

The consumer automatically starts on module initialization and persists balance data to Redis.

## Configuration

- `RABBIT_URL` – URL to RabbitMQ server (default: `amqp://localhost`)
- `REDIS_URL` – URL to Redis server (default: `redis://localhost:6379/0`)
npm package: @mohit11/pdf-catalog-generator
Description: Generate product catalog PDFs from Excel, CSV, or JSON data
Author: Mohit
Latest version: 1.0.0

# PDF Catalog Generator

Generate beautiful product catalog PDFs from Excel, CSV, or JSON data.

## Installation

```bash
npm install pdf-catalog-generator
```

## Usage

```typescript
import { generateProductCatalog } from 'pdf-catalog-generator';

// From JSON
const pdfBuffer = await generateProductCatalog({
  products: [
    {
      Title: 'Product 1',
      Description: 'Description here',
      Image: 'https://example.com/image.jpg',
      Price: 99.99,
      Rating: 4.5,
      Link: 'https://example.com/product'
    }
  ],
  companyLogo: 'https://example.com/logo.png', // or base64
  companyName: 'Your Company',
  template: 'template1' // template1, template2, or template3
});

// From Excel file
import { parseExcelFile } from 'pdf-catalog-generator';

const products = await parseExcelFile(fileBuffer);
const pdfBuffer = await generateProductCatalog({
  products,
  companyLogo: logoBase64,
  companyName: 'Your Company',
  template: 'template2'
});

// From CSV file
import { parseCSVFile } from 'pdf-catalog-generator';

const products = await parseCSVFile(csvString);
const pdfBuffer = await generateProductCatalog({
  products,
  companyLogo: logoUrl,
  companyName: 'Your Company',
  template: 'template3'
});
```

## Product Data Format

Each product should have:
- `Title` (string): Product name
- `Description` (string): Product description
- `Image` (string): Image URL or base64
- `Price` (number): Product price
- `Rating` (number): Star rating
- `Link` (string): Buy/product link

## Templates

- `template1`: Grid layout with 2 columns
- `template2`: Full-width list layout
- `template3`: Compact grid layout
npm package: @mohit11/smart-table
Description: A modular, fully customizable TypeScript-based React component library that wraps and extends Material React Table (MRT)
Author: Mohit
Latest version: 0.1.0

# @mohit11/smart-table

A modular, fully customizable TypeScript-based React component library that wraps and extends Material React Table (MRT). This library provides enhanced functionality while maintaining full compatibility with MRT's features.

## Features

- All core MRT features exposed transparently
- Built-in support for:
  - Column-level and global filters
  - Grouping, sorting, and pagination
  - Saved table states (localStorage or external persistence)
  - Export to PDF with custom templates
  - Dynamic column visibility controls
  - Column drag-and-drop
- Theming support (Material UI v5) with light/dark toggle
- Optional custom toolbars, buttons, and row-level actions

## Installation

```bash
npm install @mohit11/smart-table
```

### Peer Dependencies

This package requires the following peer dependencies:

```bash
npm install @emotion/react @emotion/styled @mui/material @mui/icons-material material-react-table react-window
```

## Basic Usage

```tsx
import { SmartTable } from '@mohit11/smart-table';

interface Person {
  id: number;
  firstName: string;
  lastName: string;
  age: number;
}

const columns = [
  {
    accessorKey: 'id',
    header: 'ID',
  },
  {
    accessorKey: 'firstName',
    header: 'First Name',
  },
  {
    accessorKey: 'lastName',
    header: 'Last Name',
  },
  {
    accessorKey: 'age',
    header: 'Age',
  },
];

const MyTable = () => {
  const data = [
    { id: 1, firstName: 'John', lastName: 'Doe', age: 30 },
    { id: 2, firstName: 'Jane', lastName: 'Smith', age: 25 },
  ];

  return (
    <SmartTable
      columns={columns}
      data={data}
      enablePDFExport={true}
    />
  );
};
```

## Documentation

For detailed documentation and advanced usage examples, please visit our [documentation page](https://github.com/mohit11/mrt-reports-mohit-fork#documentation).

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

MIT
npm package: @mohit2404/payglocal-js-client
Description: PayGlocal JS client with npm/pnpm support (no git dependencies)
Author: Mohit
Latest version: 1.0.2

# @mohit2404/payglocal-js-client

A Node.js helper library for generating **JWE** and **JWS** tokens required for
PayGlocal transaction initiation.

This package is a **community-maintained npm / pnpm distribution** of the official [`payglocal-js-client`](https://github.com/PayGlocal-Technologies/payglocal-js-client), created to resolve Docker and CI/CD issues caused by GitHub-based dependencies.

## Features

- Generate **JWE** (encrypted payload)
- Generate **JWS** (signed digest)
- Generate **JWE + JWS together** for transaction initiation
- No GitHub dependency during installation
- Compatible with **npm / pnpm / yarn**
- Node.js **≥ 16** supported

## Installation

```
npm install @mohit2404/payglocal-js-client
# or
pnpm add @mohit2404/payglocal-js-client
```

## Usage

```
const { generateJWEAndJWS } = require('@mohit2404/payglocal-js-client');
# or
import { generateJWEAndJWS } from "@mohit2404/payglocal-js-client";

const data = {
  payload, // transaction payload (required)
  publicKey, // PayGlocal public key (required)
  privateKey, // private key (required)
  merchantId, // unique merchant id (required)
  privateKeyId, // kid for private key (required)
  publicKeyId // kid for public key (required)
};

// function returns a promise which resolved to { jweToken, jwsToken }
generateJWEAndJWS(data).then((res) => {
  const { jweToken, jwsToken } = res;
  console.log({ jweToken, jwsToken });
});
# or
const { jweToken, jwsToken } = await generateJWEAndJWS(data);
console.log({ jweToken, jwsToken })
```