# aprog

> Допоміжна JavaScript-бібліотека для проєктів

Latest version **2.2.8** (published 2026-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install aprog
pnpm add aprog
yarn add aprog
bun add aprog
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2.2.8 |
| Published | 2026-09-24 |
| First published | 2025-03-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | AlexProger |
| Maintainers | alexproger |
| Keywords | aprog, js, library, tools, utilities |

## Links

- npm: https://www.npmjs.com/package/aprog
- Repository: https://github.com/uaproger/aprog-js
- Homepage: https://github.com/uaproger/aprog-js#readme
- Issues: https://github.com/uaproger/aprog-js/issues
- npm.io page: https://npm.io/package/aprog

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.2.8 (latest) — 2026-09-24
- 2.2.6 — 2025-10-16
- 2.2.5 — 2025-10-16
- 2.2.4 — 2025-10-06
- 2.2.3 — 2025-10-04
- 2.2.2 — 2025-09-29
- 2.2.1 — 2025-09-26
- 2.2.0 — 2025-09-25
- 2.1.9 — 2025-09-25
- 2.1.8 — 2025-09-17
- 2.1.7 — 2025-08-19
- 2.1.6 — 2025-08-05
- 2.1.5 — 2025-08-05
- 2.1.4 — 2025-08-05
- 2.1.3 — 2025-07-25
- … 91 more at https://npm.io/package/aprog/versions

## README

# aprog

 Допоміжна бібліотека js

*require for dev*

### NPM resource

```shell
https://www.npmjs.com/package/aprog
```

### Installation

```shell
npm install aprog --save-dev
```

or 

```shell
npm i aprog -D 
```

Завантаження `Constructs`
```shell
node node_modules/aprog/publish.js
```

Завантаження `Constructs` з перезаписом
```shell
node node_modules/aprog/publish.js --force
```

### Basic Usage

Підключення router:

```shell
import Categories from "./pages/Categories";
import Access from "./pages/Access";
import Unauthorized from "./pages/Unauthorized";

const routes = [
  {
    path: "/",
    component: NamePage,
  },
  {
    path: "/access/denied",
    component: Access,
  },
  {
    path: "/unauthorized",
    component: Unauthorized,
  }
];

document.addEventListener("DOMContentLoaded", async function() {
  // router
  const main = document.getElementById('main');
  await router({ routes, main, "Page Not Found" });
});

```

Приклад використання методів формування HTML елементів:

```shell

const elDiv = div({
  id: "id-елементу",
  class: "class-елементу",
  style: {
    width: "30px",
    height: "40px"
  },
  onClick: () => {
    console.log("Приклад роботи onClick");
  },
  value: "Приклад блоку div"
});

document.body.appendChild(elDiv);

```

Створення Pages:

```shell

const NamePage = () => {
  return div({
    class: "w-full h-screen flex flex-col items-center justify-center text-3xl",
      value: [
        div({
          class: "text-red font-bold text-5xl",
          value: "Блок №1"
        }),
        div({value: "Блок №2"})
      ]
  });
}

export default NamePage;

```

Приклад використання методів дебагу:

```shell

const int = 0;
const array = [1,2,3,4];
const boolean = true;

// виводить всі змінні в одній групі вкладок
dump(int, array, boolean);

// or 

// виводить всі змінні в одній групі вкладок та зупиняє подальше виконання скрипту
dd(int, array, boolean);

```

Приклад використання gemini:

у файл __.env__ потрібно додати api-ключ __VITE_GEMINI_KEY=you_api_gemini_key__
```shell

const message = await gemini("Розкажи жарт про програміста!");
console.log(message);

```

Робота з __mathInput__: в input вводимо 2+2=

```shell

onInput: (event) => {
  const res = mathInput(event.target);
  console.log(res);
}

```
Результат: 4 *(повертається з функції та встановлює значення у input)*
```shell
<input value="4">
```

########## ########## ########## ########## ##########

Загальний список методів:

- *dump(...args), dd(...args)*
- *redirect(url, { newTab: bool, replace: bool }), reload(delaySeconds), validateEmail(email), validatePassword(password)*
- *encrypt(str), decrypt(encryptedStr)*

- *div, span, button, a, img, meta, label, input, select, option, options, form, hr, textarea, table, caption, thead, tbody, tr, th, td, pre, attachCustomTitle* 
- *_get, _getAll, GUID, apState, date, pause, apFetch, chars, elementToObject, copyText, scrollToTop, scrollToBottom, firstKey, checkArrays, ucfirst, deepEqual, nodeListToObject*
- *isEmpty, isNull, isFloat, isNumeric, isObject, isArray, isNumber, isString, isPromise, isNull, isFloat, isNumeric, isObject*

- *router({ routes, main })*

- *navi("/path", {data: "Можливість передачі даних між сторінками"})*

- *gemini(message)*

- *mathInput(event.target)*

- *cookie, storage*

- *saveItem("id", data), loadItem("id")*

- *uniquePage({key: "default", callbackTrue: () => {"empty"}, callbackFalse: () => {"empty"}, timer: "default")*

- *const wrap = (value) => new SmartWrapper(value);*
- *wrap(data).get("key").val*

### Info

- Додано безплатний чат із `Gemini`
- Додано методи збереження зашифрованих даних `saveItem` та `loadItem`
- Додвано `Wrapper` та `Toast`
- З часом будуть додаватися можливості створення додаткових інструментів


### License
MIT License

Copyright (c) 2025 AlexProger

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

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

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

*&copy; AlexProger 2025*

---
_Source: https://npm.io/package/aprog · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
