open-index/open-npm huggingface dataset:
npm package: @randajan/1up-api
Description: API for 1up.cz
Author: Jan Randa
Latest version: 1.1.0

# @randajan/1up-api

Lightweight JavaScript client for the 1up.cz API used to generate styled QR codes.

## Installation

```bash
npm install @randajan/1up-api
```

## Import

ESM:

```js
import Qr1up from "@randajan/1up-api";
// or:
// import { Qr1up } from "@randajan/1up-api";
```

CommonJS:

```js
const { Qr1up } = require("@randajan/1up-api");
```

## Quick Example

```js
import { Qr1up } from "@randajan/1up-api";
import fetch from "node-fetch";

const qr = new Qr1up({
  fetch,
  token: "YOUR_1UP_TOKEN"
});

// Every method returns a response object.
// It contains `issues` and may contain `body` and `error`.
const response = await qr.svg(
  {
    contentType: "url",
    url: "https://1up.cz"
  },
  false // throwError = false, so errors are returned in response.error
);

if (response.error) {
  console.error(response.error.message);
} else {
  console.log(response.issues); // parsed validation/API issues
  console.log(response.body);   // SVG text
}
```

## Qr1up

### `new Qr1up(options)`

Constructor options:

- `fetch` (`function`, required): Fetch implementation (`globalThis.fetch`, `node-fetch`, ...).
- `token` (`string`, required): API token.
- `rootUrl` (`string`, optional): Defaults to `https://1up.cz/api/qr/gen`.
- `filename` (`string`, optional): Defaults to `qr`.
- `defaults` (`object`, optional): Default request payload merged into every call.

`defaults` are merged as `{...defaults, ...input}`. Values from `input` win.

### Methods

- `svg(input = {}, throwError = true)`
- `png(input = {}, throwError = true)`
- `svgBuffer(input = {}, throwError = true)`
- `pngBuffer(input = {}, throwError = true)`

Shared method arguments:

- `input` (`object`): QR configuration and content fields based on `contentType`.
- `throwError` (`boolean`):
  - `true`: network/API failures throw `Error`
  - `false`: failures are returned as `response.error`

### Response Object

All methods resolve to a response object with this shape:

```ts
type QrResponse = {
  issues?: Array<any>;
  body?: string | Buffer;
  error?: Error;
};
```

Notes:

- `issues` contains validation and API header issues (`x-qr-issues-*`).
- `body` is `string` for `svg` and `png`, `Buffer` for `svgBuffer` and `pngBuffer`.
- If request/processing fails and `throwError = false`, `error` is present.

## License

MIT
npm package: @randajan/api-kit
Description: A lightweight wrapper around fetch that always returns a structured JSON response, handling errors and network issues gracefully
Author: Jan Randa
Latest version: 1.2.0

# @randajan/api-kit

[![NPM](https://img.shields.io/npm/v/@randajan/api-kit.svg)](https://www.npmjs.com/package/@randajan/api-kit) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

JavaScript library for rendering structured data in HTML format. It supports automatic detection of tabular structures and visualization of deeply nested objects. It is ideal for debugging, admin interfaces, or displaying API responses.

## Installation


## Usage

### Server
You can use the library as an ES module:

```javascript
import createApi from "@randajan/api-kit/server";

const apiReponder = ({
    code:0,
    isAsync:false,
    timestamp:false,
    trait:(opt)=>opt,
    onOk:(resp, opt)=>{},
    onError:(resp, opt)=>{ },
    throwError:false
});


```

### Client
You can use the library as an ES module:

```javascript
import createFetch from "@randajan/api-kit/client";

const apiFetch = createFetch({
    code:0,
    url:"",
    fetch:globalThis.fetch,
    query:{},
    parseHeaders:false,             //if true it will parse response headers
    resultOnly:false,               //if true it will return only result
    timestamp:false,                //if true it will calculate timestamps
    parseBody:(body)=>body,         //custom parser for non api-kit server fetches only
    trait:(opt)=>opt,
    onOk:(resp, opt)=>{},
    onError:(resp, opt)=>{ },
    requestType:"json",             // json or form, the 'type' property is fallback
    responseType:"json",            // json or form, the 'type' property is fallback
    throwError:false
});


```



## Support

If you have any questions or suggestions for improvements, feel free to open an issue in the repository.


## License

MIT © [randajan](https://github.com/randajan)
npm package: @randajan/browser-files
Description: Lightweight browser library for reading and saving files with customizable serialization.
Author: Jan Randa
Latest version: 1.0.2

# @randajan/browser-files

[![NPM](https://img.shields.io/npm/v/@randajan/browser-files.svg)](https://www.npmjs.com/package/@randajan/browser-files)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

Lightweight browser file I/O with customizable serialization.

## Features

- save one file (`save`)
- load one file (`load`)
- load many files of the same type (`loadMany`)
- configurable `serialize` / `deserialize`
- works in both ESM and CJS consumers

API is intentionally asymmetric: there is no `saveMany`.

## Install

```bash
npm i @randajan/browser-files
```

## Quick Start (ESM)

```js
import FileIO from "@randajan/browser-files";

const io = new FileIO({
  extension: "json",
  mimeType: "application/json",
  serialize: JSON.stringify,
  deserialize: JSON.parse
});

io.save({ hello: "world" }, "example");

const one = await io.load();
const many = await io.loadMany();
```

## Quick Start (CJS)

```js
const { FileIO } = require("@randajan/browser-files");

const io = new FileIO({
  extension: "txt",
  mimeType: "text/plain"
});

io.save("Hello", "greeting");
```

## API

### `new FileIO(options?)`

```js
/**
 * @typedef {Object} FileIOOptions
 * @property {string} [mimeType="text/plain"]
 * @property {string} [charset="utf-8"]
 * @property {string} [extension="txt"]
 * @property {string} [defaultFileName="file"]
 * @property {(data:any)=>string} [serialize]
 * @property {(text:string)=>any} [deserialize]
 */
```

### `fileIO.save(data, fileName?)`

Serializes `data` and triggers one browser download.

### `await fileIO.load()`

Opens file picker and returns one deserialized value.

### `await fileIO.loadMany()`

Opens file picker in multi-select mode and returns an array of deserialized values.

## Named Exports

The package also exports helpers:

- `normalizeExtension(extension)`
- `normalizeFileName(fileName, extension, fallback?)`
- `createTextBlob(content, mimeType?, charset?)`
- `createObjectUrl(blob)`
- `revokeObjectUrl(url)`
- `downloadObjectUrl(url, fileName)`
- `createHiddenInput(extension, mimeType, multiple?)`
- `loadTexts(input, charset?, cancelCheckDelay?)`

## JSDoc

Public API is documented directly in source:

- `src/class/FileIO.js`
- `src/tools.js`

## Notes

- Browser-only API (`Blob`, `FileReader`, DOM, object URL).
- File dialogs/downloads should be called from user interaction handlers.
- Canceling picker rejects with `Error("No file selected")`.

## License

MIT (c) [randajan](https://github.com/randajan)
npm package: @randajan/cs-inflect
Description: A lightweight JavaScript library for declension of Czech numerals and nouns based on numbers, supporting singular, paucal (2–4), and genitive plural forms. Perfect for formatting grammatically correct strings in Czech.
Author: Jan Randa
Latest version: 2.0.0

# @randajan/cs-inflect

[![NPM](https://img.shields.io/npm/v/@randajan/cs-inflect.svg)](https://www.npmjs.com/package/@randajan/cs-inflect) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

**@randajan/cs-inflect** is a lightweight JavaScript library for Czech declension of numerals and nouns based on numbers. It supports singular, paucal (2–4), and genitive plural forms, making it easy to generate grammatically correct strings in Czech.

## Installation

Install the package using npm:

``` bash
npm install @randajan/cs-inflect
```

## Usage

Import the library and use the `csInflect` function to inflect numbers and format strings.

``` js
import csInflect from 'cs-inflect';

// Examples
console.log(csInflect("# sekund[y|a|y]", 1));        // "1 sekunda"
console.log(csInflect("# sekund[y|a|y]", 3));        // "3 sekundy"
console.log(csInflect("# sekund[y|a|y]", 5));        // "5 sekund"
console.log(csInflect("# hodin[a|y|]", 0, true));    // "0 hodin"
console.log(csInflect("# sekund[y|a|y]", 1.567, false, 2)); // "1.57 sekund"
```

### Parameters

#### `csInflect(str, num, zero = false, maxDecimal = 2)`

| Parameter      | Type     | Default | Description                                                                                     |
|----------------|----------|---------|-------------------------------------------------------------------------------------------------|
| `str`          | `string` | N/A     | String with the placeholder for the number (`#`) and declension pattern (e.g., `[y|a|y]`).     |
| `num`          | `number` | N/A     | Number to be formatted and used for declension.                                                |
| `zero`         | `boolean`| `false` | Whether to include zero (e.g., `"0 sekund"` if `true`).                                         |
| `maxDecimal`   | `number` | `2`     | Maximum number of decimal places for the formatted number.                                      |

### Placeholder Format

The string should contain:
- **`#`**: Placeholder for the number.
- **Declension Pattern**: A set of forms for singular, paucal, and plural in square brackets (`[decimal|singular|paucal|plural]`).


#### Example:
- `# sekund[y|a|y]`: Outputs "1 sekunda", "3 sekundy", "5 sekund".
- `# hodin[a|y|]`: Outputs "1 hodina", "3 hodiny", "10 hodin".

## Features

- Fast and lightweight.
- Automatic caching of declension patterns for efficiency.
- Handles singular, paucal, and plural forms in Czech grammar.
- Customizable decimal formatting.

Happy hacking

## License

MIT © [randajan](https://github.com/randajan)
npm package: @randajan/fio-api
Description: Fio API for bank transactions with custom columns and date support.
Author: Jan Randa
Latest version: 1.1.2

# @randajan/fio-api

[![NPM](https://img.shields.io/npm/v/@randajan/fio-api.svg)](https://www.npmjs.com/package/@randajan/fio-api) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)


This package provides a simple interface for collecting transactions from a bank account using the Fio API. It can work with data in the "YYYY-MM-DD" format or Date instances. It also allows you to add custom columns and map their values using functions.

## Installation
To install the package, use the following command:

```bash
yarn add @randajan/fio-api
```

## Usage
```javascript
import Fio from "@randajan/fio-api";

// Create an instance of Fio for the bank account with the given token
const fio = Fio.create("Your-account-ID", "Your-Fio-api-token");

// Get the latest transactions on the account
fio.paysLast((fio, pay) => {
    console.log("Transaction no.", index + 1);
    console.log("Date:", pay("Datum"));
    console.log("Amount:", pay("Objem"));
    console.log("Account number:", pay("Protiúčet"));
    // ... other transaction details ...
});

// Get transactions in a specific period
const fromDate = "2023-01-01";
const toDate = "2023-07-25";
fio.paysByPeriod(fromDate, toDate, (fio, pay) => {
    console.log("Transaction no.", index + 1);
    console.log("Date:", pay("Datum"));
    console.log("Amount:", pay("Objem"));
    console.log("Account number:", pay("Protiúčet"));
    // ... other transaction details ...
});
```

## Documentation

### Function Fio.create(accountId, token)
Creates an instance of Fio for the bank account with the specified accountId and Fio API token.

### Method Fio.fetch(path)
Fetches data from the Fio API server for the given path. Returns a list of transactions on the account.

### Method Fio.map(path, callback, ...a)
Fetches data from the Fio API server for the given path and performs data mapping using the callback function.

### Method Fio.paysLast(callback, ...a)
Gets the latest transactions on the account and performs data mapping using the callback function.

### Method Fio.paysByPeriod(fromDate, toDate, callback, ...a)
Gets transactions in a specific period and performs data mapping using the callback function.

### Function toDateString(date)
Converts the given date to the "YYYY-MM-DD" format. It can also accept Date instances.

### Function addColumnAlias(idOrAlias, ...aliases)
Adds aliases for the column with the given ID or alias.

### Function addTrait(idOrAlias, trait)
Adds a custom getter (trait) for mapping the values of the column with the given ID or alias.

### Function addUserAlias(user, alias)
Adds an alias for the user. By default it's used at trait

### Function getUserAlias(user)
Get an alias for the user.

## License
MIT

By using this package, you agree to the licensing terms.
npm package: @randajan/iban
Description: 'IBAN tools'
Author: Jan Randa
Latest version: 0.1.1


# Node @randajan/iban
[![NPM Version](http://img.shields.io/npm/v/@randajan/iban.svg?style=flat-square)](https://npmjs.com/package/@randajan/iban)
[![License](http://img.shields.io/npm/l/@randajan/iban.svg?style=flat-square)](http://opensource.org/licenses/MIT)

This library provides utility functions for validating and formatting International Bank Account Numbers (IBAN) using iso-7064 lib.

## Installation

Install the package using npm:

```bash
npm install @randajan/iban
```

or 

```bash
yarn add @randajan/iban
```

## Usage

Import the necessary functions from the @randajan/iban package:

```js
import { validateIBAN, formatIBAN, getIBAN } from '@randajan/iban';
```

### validateIBAN(iban)

This function validates the given IBAN.

Parameters:

- iban (string): The IBAN to validate.

Returns:

- true if the IBAN is valid.
- false if the IBAN is invalid.

### formatIBAN(iban)

This function formats the given IBAN by adding spaces every 4 characters.

Parameters:

- iban (string): The IBAN to format.

Returns:

- The formatted IBAN string with spaces every 4 characters.

### getIBAN(country, bank, account, format = false)

This function generates a valid IBAN for the specified country, bank, and account details.

Parameters:

- country (string): The country code (e.g., "GB", "DE").
- bank (string): The bank code.
- account (string): The account number.
- format (boolean): Optional. If true, the generated IBAN will be formatted with spaces every 4 characters (default is false).

Returns:

- The generated valid IBAN string.

## Examples

```js
import { validateIBAN, formatIBAN, getIBAN } from 'iban-utils';

const iban = 'GB32WEAK12345612345678';

console.log(validateIBAN(iban));  // Output: true
console.log(formatIBAN(iban));    // Output: 'GB32 WEAK 1234 5612 3456 78'

const generatedIBAN = getIBAN('GB', 'WEAK123456', '12345678', true);
console.log(generatedIBAN);      // Output: 'GB32 WEAK 1234 5612 3456 78'
```

## License
This project is licensed under the MIT License - see the [LICENSE file](https://github.com/randajan/iban/blob/main/LICENSE) for details.
npm package: @randajan/jet-base
Description: Ecosystem of types and related usefull tools.
Author: Jan Randa
Latest version: 2.3.2

# @randajan/jet-base

[![NPM](https://img.shields.io/npm/v/@randajan/jet-base.svg)](https://www.npmjs.com/package/@randajan/jet-base) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

Goal was to create universal structure for storing variables with watcher and validator.

## Install

```bash
npm install @randajan/jet-base
```

or

```bash
yarn add @randajan/jet-base
```

## Usage

### Init
```js
import { BaseSync } from "@randajan/jet-base";

const base = new BaseSync();
base.init(true) // initialize base (first argument = debug on/off)
```

there is also possibility to use 'base.config(true)' instead. Base will be initialized with arguments passed to config function when it will be necessarily


### Set
function that simply assign values. For rewrite whole structure it can be used with object as first argument:

```js
base.set({a:1, b:2, c:3, d:{x:123}});
```

or first argument could be path, and second argument value:

```js
base.set("a", 1);
base.set("b", 2);
base.set("c", 3);
base.set("d.x", 123);
```
result will be the same.

### Get
accessing stored values first argument could be path
```js
base.get("d") == {x:123};
base.get("d.x") === 123;
```
result is everytime a deep copy. 

### Is / IsType / IsFull
simple comparing
```js
base.is("d.x", 123) === true;
base.isType("d.x", "Number") === true;
base.isFulll("d.y") === false;
```

### Fit
validator of value with middleware iterator. Also accept path as first argument
```js
base.fit("a", (next, value, valueBefore)=>next(value > 0 ? 0 : value));
```
after defining new validator base will reprocess last input.

### Watch
run me when variable under path has changed
```js
base.watch("a", (get, changes)=>console.log(get()));
```
after any change at desired path will be called this function. Passing two arguments. Both are functions. get() will return value at same path and changes() will return list of sub changes;

### Async
async version working pretty same

```js
import { BaseAsync } from "@randajan/jet-base";

const base = new BaseAsync(); 
base.config(true) // config base for later use (first argument = debug on/off)
```

## License

MIT © [randajan](https://github.com/randajan)
npm package: @randajan/jet-react
Description: Tools for quick webdev with react
Author: Jan Randa
Latest version: 3.0.2

# @randajan/jet-react

[![NPM](https://img.shields.io/npm/v/@randajan/jet-react.svg)](https://www.npmjs.com/package/@randajan/jet-react) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

This package boost react page development.

## Install

```bash
npm install @randajan/jet-react
```

or

```bash
yarn add @randajan/jet-react
```


## Primitive

### Element
### Event
    - event.jet.cut(stopBubling=false) is shorthand for event.preventDefault() and event.stopBuubling
### ReactComponent
### ReactElement

## Hooks

### useBase
### useDrift
### useFocus
### useForceRender

## Base

### Page
### Screen

## License

MIT © [randajan](https://github.com/randajan)
npm package: @randajan/pdfkit-dom
Description: PDFKit computed rendering with use of elements and styling
Author: Jan Randa
Latest version: 1.1.2

# @randajan/pdfkit-dom

[![NPM](https://img.shields.io/npm/v/@randajan/pdfkit-dom.svg)](https://www.npmjs.com/package/@randajan/pdfkit-dom) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

Goal is to imitate functionality of AppSheet.

## Install

```bash
npm install @randajan/pdfkit-dom
```

or

```bash
yarn add @randajan/pdfkit-dom
```

## Demo
I hope i will had time to describe this package.
Meanwhile check demo folder.

This major version doesn't support multipage PDF

## License

MIT © [randajan](https://github.com/randajan)
npm package: @randajan/ram-db
Description: Realtime database
Author: Jan Randa
Latest version: 2.9.1

# @randajan/ram-db

[![NPM](https://img.shields.io/npm/v/@randajan/ram-db.svg)](https://www.npmjs.com/package/@randajan/ram-db) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

Goal is to imitate functionality of AppSheet.

## Install

```bash
npm install @randajan/ram-db
```

or

```bash
yarn add @randajan/ram-db
```


## Main methods

### DB

.count()
.exist(tableName)
.get(...)

### Table

### Cols

### Col

### Rows

### Row

### RowWrap


## License

MIT © [randajan](https://github.com/randajan)
npm package: @randajan/react-form
Description: Basic react forms and fields :)
Author: Jan Randa
Latest version: 5.2.7

# @randajan/react-form

[![NPM](https://img.shields.io/npm/v/@randajan/react-form.svg)](https://www.npmjs.com/package/@randajan/react-form) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install @randajan/react-form
```

or

```bash
yarn add @randajan/react-form
```

## Usage

One day I will either finish and document this package, or I will kick the bucket, we'll see which comes first.

## License

MIT © [randajan](https://github.com/randajan)
npm package: @randajan/regex-parser
Description: Convert between JavaScript RegExp and its string representation. Simple, safe and lightweight.
Author: Jan Randa
Latest version: 0.0.2

# @randajan/regex-parser

[![NPM](https://img.shields.io/npm/v/@randajan/regex-parser.svg)](https://www.npmjs.com/package/@randajan/regex-parser) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

Convert between JavaScript **RegExp** objects and their `/pattern/flags` string form — simple, safe and lightweight.

---

## Install

```bash
npm i @randajan/regex-parser
```

---

## Quick use

```js
import { rgxToStr, strToRgx } from "@randajan/regex-parser";
// or: const { rgxToStr, strToRgx } = require("@randajan/regex-parser");

const re  = /hello\/world/i;
const str = rgxToStr(re);   // "/hello\\/world/i"
const re2 = strToRgx(str);  // ⇢ /hello\/world/i
```

---

## API

### `rgxToStr(regexp) → string`

Serialises a `RegExp` into `/pattern/flags`, escaping **only** those `/` that are not already escaped.

### `strToRgx(string, strict = false) → RegExp`

* **If** the string matches `/pattern/flags`, parse it.
* **Else**  
  * when **strict = false** (default) return a safe literal regex with the text escaped,
  * when **strict = true** throw `SyntaxError`.

```js
strToRgx("/\d+/g");              // → /\d+/g
strToRgx("user.name?");           // → /user\.name\?/
strToRgx("user.name?", true);     // throws
```

---

## Example round‑trip test

```js
const originals = [/foo\/bar/i, /a+b*c?.(x|y)/g];

originals.forEach(r => {
  const r2 = strToRgx(rgxToStr(r));
  console.assert(r2.source === r.source && r2.flags === r.flags);
});
```

---

### Why another regex helper?

* **Zero dependencies** – <1 kB min+gzip  
* **Predictable** – strict mode prevents silent surprises  
* **Universal** – Node ≥12 & all modern browsers

---

## License

MIT © [randajan](https://github.com/randajan)
npm package: @randajan/rsc-builder
Description: A easy to use utility library for MikroTik script development with bundling capabilities.
Author: Jan Randa
Latest version: 0.0.7

# rsc-builder

[![NPM](https://img.shields.io/npm/v/@randajan/rsc-builder.svg)](https://www.npmjs.com/package/@randajan/rsc-builder) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

rsc-builder is a easy to use utility library for MikroTik script development with bundling capabilities.

## Installation

Install the library using npm:

```bash
npm install -d @randajan/rsc-builder
```

Or using yarn:

```bash
yarn add @randajan/rsc-builder
```

## Usage

```javascript
import RSCbuild from "@randajan/rsc-builder";

RSCbuild({
    live: true, // Enables a watcher that triggers a build 500ms after the last source code change
    version: "1.0.0", // General variable present in all scripts, specifying the version of the entire build
    entries:[ // List of input files from which builds will be created
        "template.rsc",
        "script.rsc",
    ],
    srcDir: "src", // Folder where source files are stored
    distDir: "dist", // Folder where builds are exported
});
```

## General Builder Functions

### Importing another script file

```plaintext
%%./path/to/subscript.rsc%%
```

### Importing another script file with escaping

```plaintext
##./path/to/subscript.rsc##
```

Useful when creating a file for script import like

```plaintext
/system script add source="##./path/to/subscript.rsc##";
```

### Variable

```plaintext
${version}
```

This example will be replaced with the value of the version provided to builder

## Extra function

You can also pass extra variables to the imported script file that will be used to fill variable in that file.

```plaintext
%%./path/to/subscript.rsc { "extra":"variable" }%%
```

or 

```plaintext
##./path/to/subscript.rsc { "foo":"bar" }##
```

Builder is expecting JSON formated variables.
If there is present variable ${foo} at the file subscript.rsc it will be replaced by builder with string "bar".


## Known bugs
- Builder is recursive, but there is no check for possible loops.
- Every file provided in entries will be stored directly at dist folder even if it's source is at subfolder.


## License

MIT © [randajan](https://github.com/randajan)
npm package: @randajan/say
Description: Tiny, chainable phrase lookup helper for simple localization with fallbacks.
Author: Jan Randa
Latest version: 1.1.2

# @randajan/say

[![NPM](https://img.shields.io/npm/v/@randajan/say.svg)](https://www.npmjs.com/package/@randajan/say) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

A tiny, chainable phrase lookup helper for simple localization with fallbacks.

This project is a small toy for experimenting with callable objects and minimal translation tables.

## Installation

```bash
npm install @randajan/say
```

## Exports (CJS / ESM)

ESM:

```js
import Say, { Say as SayClass } from "@randajan/say";
```

CommonJS:

```js
const Say = require("@randajan/say");
const { Say: SayClass } = require("@randajan/say");
```

## API

### `new Say(options)`

Creates a callable instance that can be invoked like a function: `say("phraseId", "en")`.

Options:
- `langs` (`string[]`): Ordered list of language codes.
- `translations` (`Record<string, string[]>`): Phrase table, where each entry aligns with `langs`.
- `defaultLang` (`string`): Default language to use when none is provided. If omitted, `langs[0]` is used. Can be changed later via `setLang`.
- `parent` (`Say | null`): Optional parent instance for fallback lookups.

### `say(phraseId, lang?)`

Returns the translation for `phraseId` in `lang` or the current default language. Falls back to `parent` if not found.

### `bindLang(lang)`

Returns a new instance with `defaultLang` set to `lang`, keeping the same language list and parent chain.

### `setLang(lang)`

Mutates the current instance by setting `defaultLang` to `lang` and returns the same instance.

### `extend({ defaultLang, langs, translations } = {})`

Creates a new instance that can override `defaultLang`, `langs`, or `translations` and chains the current instance as `parent`.

### `append(brother)`

Appends another `Say` instance as a "brother" for fallback lookups. Returns the same instance. `brother` must be an instance of `Say`.

### `has(phraseId, lang?)`

Returns `true` if the phrase exists (including via fallback), otherwise `false`.

### `sayOr(phraseId, fallback, lang?)`

Returns the phrase if found; otherwise returns `fallback`.

## License

MIT
npm package: @randajan/sleep
Description: Tiny async utilities for timeout and sleep using native Promises.
Author: Jan Randa
Latest version: 0.1.1

# @randajan/sleep

[![NPM](https://img.shields.io/npm/v/@randajan/sleep.svg)](https://www.npmjs.com/package/@randajan/sleep) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)


Tiny async utilities for timeout and sleep using native Promises.

_I was tired of writing it again and again_


## Installation

```bash
npm install @randajan/sleep
```

## Usage

```js
import { sleep, timeout, prolong, withTimeout } from "@randajan/sleep";

// Wait 500ms and resolve with "done"
await sleep(500, "done");

// Wait 500ms and reject with "Timeout"
await timeout(500);

// Wait 1000ms and resolve with "OK"
await prolong(1000, true, "OK");

// Wait 1000ms and reject with custom error
await prolong(1000, false, new Error("Custom timeout"));

// Wrap any promise and reject if it does not resolve in time
await withTimeout(fetch(url), 2000);
```

## API

### `sleep(ms, result)`
Resolves `result` after `ms` milliseconds.

### `timeout(ms, error)`
Rejects `error` after `ms` milliseconds (default: `new Error("Timeout")`).

### `prolong(ms, ok, result)`
Resolves (if `ok` is `true`) or rejects (if `false`) with `result` after `ms` milliseconds.

### `withTimeout(promise, ms, error)`
Resolves or rejects with `promise`, but rejects with `error` after `ms` milliseconds.


## License

MIT
npm package: @randall71/expo-router-top-tabs
Description: Top tabs with optional header in Expo Router
Author: Randall71
Latest version: 1.0.2

# @bacons/expo-router-top-tabs

Wraps `react-native-collapsible-tab-view` and adds support for [Expo Router](https://expo.github.io/router/docs).

## Add the package to your npm dependencies

```
yarn add @bacons/expo-router-top-tabs react-native-reanimated
```

- Setup Reanimated in the `babel.config.js`. See [here](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation#babel-plugin) for more info.

## Usage

Example in Layout Route:

```js
// app/(tabs)/_layout.tsx

import { Text, View } from "react-native";
import { TopTabs } from "@bacons/expo-router-top-tabs";

export default function CustomLayout() {
  return (
    <TopTabs screenOptions={{}}>
      <TopTabs.Header>
        <View pointerEvents="none" style={{}}>
          <Text>Header</Text>
        </View>
      </TopTabs.Header>

      <TopTabs.Screen name="index" />
    </TopTabs>
  );
}
```

Usage in child routes:

```js
// app/(tabs)/index.tsx

import { Animated } from "react-native";
import { useScrollProps } from "@bacons/expo-router-top-tabs";

export default function Screen() {
  const props = useScrollProps();

  return <Animated.ScrollView {...props}></Animated.ScrollView>;
}
```
npm package: @randan/tg-logger
Description: Shared NestJS logger and admin notification modules for Telegram bots
Latest version: 1.0.4

# @randan/tg-logger

Shared NestJS modules for Telegram bots: environment-aware logger and admin notification service.

## Installation

```bash
npm install @randan/tg-logger
```

### Peer dependencies

```bash
npm install @nestjs/common @nestjs/config nestjs-telegraf telegraf
```

## Modules

### LoggerModule

Global NestJS module providing `LoggerService`.

- `log(...args)` — logs only in development (`NODE_ENV=development`)
- `error(...args)` — always logs to stderr
- `warn(...args)` — always logs to stderr

### NotifyAdminModule

Global NestJS module providing `NotifyAdminService`.

Sends Telegram messages to the admin user specified by `ADMIN_TELEGRAM_ID` env variable. Silently skips if the variable is not set.

- `send(message, options?)` — sends a message with optional `parse_mode` (`'Markdown'` | `'HTML'`)

## Usage

### 1. Import modules in `app.module.ts`

```typescript
import { LoggerModule, NotifyAdminModule } from '@randan/tg-logger';

@Module({
  imports: [
    ConfigModule.forRoot({ isGlobal: true }),
    TelegramModule,
    LoggerModule,
    NotifyAdminModule,
  ],
})
export class AppModule {}
```

Both modules are `@Global()`, so services are available everywhere without extra imports.

### 2. Inject services

```typescript
import type { LoggerService, NotifyAdminService } from '@randan/tg-logger';

@Injectable()
export class MyService {
  constructor(
    private readonly logger: LoggerService,
    private readonly notifyAdmin: NotifyAdminService,
  ) {}

  doWork(): void {
    this.logger.log('Processing started');
    this.notifyAdmin.send('Something happened', { parse_mode: 'HTML' });
  }
}
```

## Environment variables

| Variable | Required | Description |
|---|---|---|
| `NODE_ENV` | No | Set to `development` to enable `log()` output |
| `ADMIN_TELEGRAM_ID` | No | Telegram user ID for admin notifications |

## License

MIT
npm package: @randaotoken/component-library
Description: [![npm version](https://img.shields.io/npm/v/@randaotoken/component-library.svg)](https://www.npmjs.com/package/@randaotoken/component-library) [![npm downloads](https://img.shields.io/npm/dm/@randaotoken/component-library.svg)](https://www.npmjs.com/pack
Author: RandAO Labs
Latest version: 0.0.41

# RandAOToken Component Library

[![npm version](https://img.shields.io/npm/v/@randaotoken/component-library.svg)](https://www.npmjs.com/package/@randaotoken/component-library)
[![npm downloads](https://img.shields.io/npm/dm/@randaotoken/component-library.svg)](https://www.npmjs.com/package/@randaotoken/component-library)
[![Build Status](https://github.com/RandAOLabs/component-library/actions/workflows/publish.yml/badge.svg)](https://github.com/RandAOLabs/component-library/actions/workflows/publish.yml)
[![Storybook](https://raw.githubusercontent.com/storybooks/brand/master/badge/badge-storybook.svg)](https://randaolabs.github.io/component-library)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A sleek modern React component library with TypeScript support and theming, optimized for Vite.

## Installation

```bash
npm install @randaotoken/component-library
```

## Usage

Import components directly from the library:

```tsx
import { Button, ThemeProvider } from '@randaotoken/component-library';

function App() {
  return (
    <ThemeProvider>
      <Button variant="primary">Click me</Button>
    </ThemeProvider>
  );
}
```

### Vite Integration

This library is optimized for Vite and provides source files directly:
- TypeScript source with full type support
- CSS imports handled automatically by Vite
- Control-click navigation to component source
- Hot Module Replacement (HMR) support
- Source maps for debugging

### Note for Non-Vite Users

This library is designed to be used with Vite. While it may work with other build tools, we recommend using Vite for the best development experience.

## Available Components

```tsx
import {
  // Theme (required)
  ThemeProvider,
  
  // Components
  Button,
  Spinner,
  ThemeToggle,
  Tooltip,
  InfoIcon,
  Table,
  SocialIcons,
  ConnectWallet,
  
  // Hooks
  useTheme,
  useThemeToggle,
  useWallet
} from '@randaotoken/component-library';
```

## Documentation

- [Components](docs/components.md) - Available components and usage
- [Theme System](docs/theme-system.md) - Theming and customization
- [Development](docs/development.md) - Contributing and development setup

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

<div align="center">
Made with ❤️ by the RandAO team
</div>
npm package: @randika-srimal/time-slot-picker
Description: This will add a beautiful embedded time picker to your website.
Author: Randika Srimal
Latest version: 1.1.1


# Time Slot Picker - jQuery Plugin

This will add a beautiful embedded time picker to your website. 


## Installation 

Install time-slot-picker with npm

```bash 
  npm i @randika-srimal/time-slot-picker
```
    
## Usage/Examples

```html
<div id="time-slot-picker"></div>
```
```javascript
$('#time-slot-picker').timeSlotPicker(
    {
        startTime:'00:00',
        endTime:'24:00',
        timeStep:'15',
        defaultDate:'2021-05-31',
        maxDateTime:'2021-06-01 13:15',
        minDateTime:'2021-05-28 10:15',
        minDayTime:'09:00',
        maxDayTime:'18:00',
        inputElementSelector:'#time-slot-input',
        headerColor:'#205C40',
        headerTextColor:'#ffffff',
        activeSlotColor:'#74956C',
    }
);
```
These passing options are all optional.

When a time slot selected it will trigger a `timeSlotSelected` event and when discarded it will trigger `timeSlotDiscarded` events. You can catch these to run your methods.

```javascript
$('#time-slot-input').on('timeSlotSelected',function(){
  // Your functions
});

$('#time-slot-input').on('timeSlotDiscarded',function(){
    // Your functions
});
```
  
## Screenshots

![Plugin Screenshot](https://user-images.githubusercontent.com/7983447/120070508-83034380-c0a8-11eb-8883-9ad530c151bb.png)

  
## License

[![MIT License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/)

  
## Support

For support, email email2randika@gmail.com.