open-index/open-npm huggingface dataset:
npm package: @n0n3br/clone-deep
Description: clone-deep is a little library you can use to clone your objects, no matter how deep they are.
Author: Rogério Luiz Aques de Amorim
Latest version: 1.0.0

# clone-deep

![Build Status](https://travis-ci.com/n0n3br/clone-deep.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/n0n3br/clone-deep/badge.svg)](https://coveralls.io/github/n0n3br/clone-deep)

clone-deep is a little library you can use to clone your objects, no matter how deep they are.

## Installation

Use the package manager [npm](https://www.npmjs.com/) to install clone-deep

```bash
npm install @n0n3br/clone-deep
```

## Usage

#### ES6

```javascript
import cloneDeep from "@n0n3br/clone-deep";
let a = { a: [1, 2, 3], b: [4, 5, 6] };
let b = cloneDeep(a);
```

#### CommonJS

```javascript
var cloneDeep = require("@n0n3br/clone-deep").default;
var a = { a: [1, 2, 3], b: [4, 5, 6] };
var b = cloneDeep(a);
```

#### UMD in Browser

```html
<!-- to import non-minified version -->
<script src="clone-deep.umd.js"></script>

<!-- to import minified version -->
<script src="clone-deep.umd.min.js"></script>
```

After this the library will be available to the Global as cloneDeep:

```javascript
let a = { a: [1, 2, 3], b: [4, 5, 6] };
let b = cloneDeep(a);
```

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).

## Authors

| ![Rogério Amorim](https://avatars2.githubusercontent.com/u/371808?s=100&v=4) |
| :--------------------------------------------------------------------------: |
|                 [Rogério Amorim](https://github.com/n0n3br)                  |

See also the list of [contributors](https://github.com/n0n3br/clone-deep/graphs/contributors) who participated in this project.

## License

[MIT](https://choosealicense.com/licenses/mit/)
npm package: @n0n3br/react-use-indexeddb
Description: A React hook for easy IndexedDB integration
Author: Rogério Amorim
Latest version: 1.0.2

# @n0n3br/react-use-indexeddb

A React hook for easy IndexedDB integration. This hook simplifies working with IndexedDB in React applications by providing a clean and intuitive API.

## Installation

```bash
npm install @n0n3br/react-use-indexeddb
```

## Usage

```typescript
import { useIndexedDB } from '@n0n3br/react-use-indexeddb';

interface Todo {
  id: string;
  title: string;
  completed: boolean;
}

function TodoList() {
  const {
    add,
    get,
    getAll,
    put,
    remove,
    clear,
    error,
    isReady,
    data
  } = useIndexedDB<Todo>({
    dbName: 'TodoDB',
    version: 1,
    storeName: 'todos'
  });

  // Add a todo
  const handleAdd = async (todo: Todo) => {
    await add(todo);
  };

  // Get a specific todo
  const handleGet = async (id: string) => {
    const todo = await get(id);
  };

  // Get all todos
  const handleGetAll = async () => {
    const todos = await getAll();
  };

  // Update a todo
  const handleUpdate = async (todo: Todo) => {
    await put(todo);
  };

  // Remove a todo
  const handleRemove = async (id: string) => {
    await remove(id);
  };

  // Clear all todos
  const handleClear = async () => {
    await clear();
  };

  if (!isReady) {
    return <div>Loading...</div>;
  }

  if (error) {
    return <div>Error: {error.message}</div>;
  }

  return (
    <div>
      {data.map(todo => (
        <div key={todo.id}>{todo.title}</div>
      ))}
    </div>
  );
}
```

## API

### Configuration

The hook accepts a configuration object with the following properties:

- `dbName` (string): The name of the IndexedDB database
- `version` (number): The version of the database
- `storeName` (string): The name of the object store

### Return Value

The hook returns an object with the following properties:

- `add(item: T)`: Adds a new item to the store
- `get(id: string | number)`: Retrieves an item by ID
- `getAll()`: Retrieves all items from the store
- `put(item: T)`: Updates an existing item or adds it if it doesn't exist
- `remove(id: string | number)`: Removes an item by ID
- `clear()`: Removes all items from the store
- `error`: Any error that occurred during database operations
- `isReady`: Whether the database is ready for operations
- `data`: Array of all items in the store

### Types

Items must have an `id` property of type `string` or `number`:

```typescript
interface Item {
  id: string | number;
  // ... other properties
}
```

## License

MIT © Rogério Amorim
npm package: @n0n3br/react-use-page-visibility
Description: A React hook to detect if the browser tab is currently visible/active to the user.
Author: rogeriolaa
Latest version: 0.0.3

# `react-use-page-visibility`

A React hook to detect if the browser tab is currently visible/active to the user.

## Installation

```bash
npm install @n0n3br/react-use-page-visibility
# or
yarn add @n0n3br/react-use-page-visibility
# or
pnpm add @n0n3br/react-use-page-visibility
```

## Usage

```typescript
import { usePageVisibility } from "@n0n3br/react-use-page-visibility";

function MyComponent() {
  const isVisible = usePageVisibility();

  return (
    <div>
      <p>Page is {isVisible ? "visible" : "hidden"}</p>
    </div>
  );
}
```

## API

### `usePageVisibility(): boolean`

Returns a boolean indicating whether the page is currently visible (`true`) or hidden (`false`).

## Contributing

Contributions are welcome! Please open an issue or submit a pull request.

## License

MIT
npm package: @n0n3br/svelte-createstore
Description: Svelte 3 module to create a store with support do sync and async actions
Latest version: 0.1.6

# svelte-createstore

Svelte 3 related module to create a store with support to modules and sync/async actions

## why i did this

Svelte 3 provides a basic store that is perfectly fine for small applications.

When your app grows, it's always a good idea to extract the business logic from components to keep them lean and focused on what they're primarlly design to do - interact with the user.

Inspired by other state management solutions, I ´wrote a code that automatically creates a writable store and ´provides access to the actions, so that components can interact with the data withou having to know the business logic to do it.
I also added support for async actions and modules, so it can be used in api fetch operations, for example.

## how to use

createStore is a method that requires 3 parameters:

- initialState: value that will be loaded in the state key of the store once it's created. It must be a valid object.

- actions: and object that describes the actions that will update the store state. This is the only way to update the store, no update or set default Svelte store methods are supported. Each action is composed of a name (the key itself) and a function that receives the current state as the first parameter and the other arguments passed after. The function must return the updated state. Async functions are supported. To call modules actions just use the module name dot the action name.

- modules: an object that lists the modules to be included in the store. It's not a required parameter, if not informed the store will be create withou modules. The object keys will be the modules names. A module descbribes a subset of a state, with it's own initialState and actions. Each module is a object with inititalStore and actions keys, like the root state. Modules actions has access only to that modules state.

The execution of createStore returns an object that has all the actions provided and can be executed by any component.

The returned object can also be used to subscribe to changes using the subscribe method like Svelte native store.

The callback function of the subscribe method will receive as a variable an object with 3 keys:

- state: the current state of the store, including modules state in module's names keys.

- error: if any error occurs during an action execution, it will contain the error message. Otherwise is null

- loading: it turns to true when an async action is executed and to false when it ends.

## example

A complete usage example can be found in my [github repository](https://github.com/n0n3br/svelte-createstore/tree/master/example)
npm package: @n0safe/indirectus
Description: Directus Tools CLI.
Author: Mathis Sebille
Latest version: 1.5.5

# Indirectus

## Overview

Just some Directus stuff.

## Type Generator

So, this is my take on the code generation for Directus, releasing it to catch some early bugs that might happen.

### Overview

Right now it's pretty simple and it's just going to output some types and utility functions that are compatible with the current Directus SDK, but it was designed to support custom outputs (because I use Directus in several different languages). Right now I won't expand (or document) on the templating side, because I still need to get to the final data model and make it stable to export to the template engine.

### Execution

```sh
npx indirectus sdk generate --url http://localhost:8055 --token <some-static-token-with-admin-privileges>
```

### Output

A local `.directus` folder will be created containing schema cache + the generated client output.

The `.directus/generated/client.ts` exports:

- Readable code.
- A `Schema` type with all your schema mappings (use it while creating the client with the SDK's `createDirectus<Schema>` method.)
- Several functions to pass to `client.request(fn)` to make data fetching cleaner.
- It's smart enough to dig into some commonly used interfaces in order to fetch their possible values (you'll see them as an union), but unfortunatle the SDK at the moment will strip them out (SDK bug?)

## Links

- https://github.com/linefusion/indirectus/
- https://www.npmjs.com/package/indirectus

# Contributing

Easiest way to develop, build and test is:

- Make sure to `pnpm install`
- Keep a terminal running `pnpm dev`
- Test CLI commands with `pnpm indirectus`, for example `pnpm indirectus sdk generate`
  - To make it easier, create a `.env` file on the workspace root containing your server settings
    - `DIRECTUS_URL=http://....`
    - `DIRECTUS_TOKEN=.....`
npm package: @n0str/editorjs-math
Description: Math Block for Editor.js
Author: n0str
Latest version: 1.0.3

![](https://badgen.net/badge/Editor.js/v2.0/blue)

# Math Tool for Editor.js
![image](https://user-images.githubusercontent.com/51183663/86523997-4c787500-bea7-11ea-8f96-36b96d6ff96d.png)

Transform laTex text to pretty math equations

Demo: https://flaming-cl.github.io/editorPlugin  
This is a plugin for Editor.js. To use this package, you need to install [editorjs](https://www.npmjs.com/package/@editorjs/editorjs) first   
Here are the supported functions: https://katex.org/docs/supported.html  

### Install via NPM

Get the package

```shell
npm i --save-dev editorjs-math
```

### Load from CDN
```javascript
<script src="https://cdn.jsdelivr.net/npm/editorjs-math@1.0.2/dist/bundle.js"></script>
```
### Include the module in your application

```javascript
const mathTex = require('editorjs-math');
// or import MathTex from 'editorjs-math';
```
## Usage

Add a new Tool to the `tools` property of the Editor.js initial config.

```javascript
var editor = EditorJS({
  ...
  
  tools: {
    ...
    math: {
      class: MathTex, // for CDN: window.MathTex
    },
  }
  
  ...
});
```

## Config Params

This Tool has no config params

## Output data

| Field  | Type     | Description      |
| ------ | -------- | ---------------- |
| text   | `string` | Math text |

```json
  {
        "type" : "math",
        "data" : {
            "text" : "\\{1,2,3,\\ldots ,n\\}",
        }
    }
```

## Credits
Katex: https://github.com/KaTeX/KaTeX
npm package: @n0ts123/worktip
Description: 提供三阶段开发工作流协议的 MCP 服务器，帮助 AI 编程工具遵循规范的分析、方案、执行流程
Latest version: 1.0.5

# WorkTip MCP Server

一个为 AI 编程工具提供核心开发执行协议的 MCP Server。

所有支持 MCP 配置的工具都可以使用，比如 Cursor、Claude Code、Windsurf 等。

## 核心协议

完整协议内容如下，可直接使用：

```
# 核心执行协议
> 原则：先想清楚，再动手。未经确认，禁止修改。
---
## 阶段一：分析
理解需求后，必须全面了解相关代码：
1. **理解业务逻辑**
   - 这个需求的目标是什么？
   - 完整流程是什么？涉及哪些模块？
   - 有哪些边界情况和异常流程？
2. **阅读关联代码**
   - 找到所有相关文件，通读一遍
   - 理解现有实现逻辑
   - 识别可能影响的其他模块
3. **评估影响**
   - 修改是否影响其他功能？
   - 是否涉及全局状态、共享配置？
**禁止**：直接修改代码。
有问题直接问我。
---
## 阶段二：方案
### 1. 实现思路
- 为什么这样设计？
- 核心逻辑怎么实现？
### 2. 可选方案对比
- 有哪些可行的方案？
- 各方案的优缺点
- 为什么选择当前方案
### 3. 变更清单
- 改动哪些文件
- 每个文件大概改什么
- 依赖关系、影响范围
**必须**：消除重复代码（DRY）。
完成后问："方案已列出，是否执行？"
---
## 阶段三：执行
按方案实现，完成后进行测试：
1. **功能测试**
   - 正常流程走通
   - 边界情况和异常场景
2. **回归测试**
   - 检查是否影响现有功能
3. **代码检查**
   - 类型检查 / 编译通过
   - 检查遗漏
**禁止**：未经确认提交代码。
---
**核心**：未经确认，禁止修改任何代码。
```

如果添加到项目的 `CLAUDE.md` 或 `cursor rule` 中，就不需要安装 MCP 了。

## 安装配置

### Claude Code

```bash
claude mcp add worktip -s user -- npx -y @n0ts123/worktip
```

### Cursor

Cursor Settings -> Tools & Integrations -> MCP Tools，添加：

```json
{
  "mcpServers": {
    "worktip": {
      "command": "npx",
      "args": ["-y", "@n0ts123/worktip"]
    }
  }
}
```

### 淘宝镜像（国内用户推荐）

如果访问 npm 缓慢，可以使用淘宝镜像：

```json
{
  "mcpServers": {
    "worktip": {
      "command": "npx",
      "args": [
        "-y",
        "--registry",
        "https://registry.npmmirror.com",
        "@n0ts123/worktip"
      ]
    }
  }
}
```

其他编程工具配置方式类似。

无需预先安装，npx 会自动下载最新版本。

## 使用方法

在对话中调用 `worktip` 工具即可返回完整协议：

```
使用 worktip
use worktip
```

或直接在对话中说明需要执行协议，AI 会自动识别并调用。

## 工具说明

本服务器提供一个工具：

- **`worktip`**：返回核心开发执行协议，帮助你以正确的方式处理开发任务

## License

MIT

---

Made with ❤️ by [N0ts](https://github.com/N0tsLabs)
npm package: @n0uur/is-odd-ai
Description: A neural network that determines if a number is odd number or not
Author: Krittanut Siripornnoppakhun
Latest version: 0.1.1

# Neural Network for Odd Number Prediction

A simple neural network implementation in TypeScript that predicts whether a number is odd or even. This is a proof-of-concept project demonstrating neural networks for binary classification.
This project is just for fun, don't expect anything useful from this.

## Installation

```sh
npm install @n0uur/is-odd-ai
```

## Usage

```typescript
import isOdd from "@n0uur/is-odd-ai";

const result = isOdd(123);
console.log(result); // true
```

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## Contributing

Any pull requests are welcome.
npm package: @n0uur/thaibaht-text
Description: Thai Baht converter package for Node.js, Powered by 'to-words' & 'bahttext' to support both Thai and English
Author: Krittanut S
Latest version: 1.0.3

# Thai Baht To Text Converter (EN/TH)

Node.js package to convert numerical values into written text in both Thai and English, specifically formatted for Thai Baht currency values. It leverages the 'to-words' package with some conditions for English conversions and utilizes 'bahttext' for Thai language support.

PS. I'm creating this package for my own personal use and I just wanted to make it public in case anyone else finds it useful even if it's pretty useless.

## DEMO

Check it out here: [https://n0uur.github.io/thaibaht-text](https://n0uur.github.io/thaibaht-text/)

## Features and Usage

- Converts numerical values into written text in both Thai and English

```ts
// ---- Import ----

// CommonJS
const toBahtText = require("@n0uur/thaibaht-text").default;
const { toBahtTextEnglish, toBahtTextThai } = require("@n0uur/thaibaht-text");

// ES6
import toBahtText, { toBahtTextThai, toBahtTextEnglish } from "@n0uur/thaibaht-text";

// ---- Usage ----

console.log(toBahtText(123)); // OUTPUT: หนึ่งร้อยยี่สิบสามบาทถ้วน
console.log(toBahtTextThai(123)); // OUTPUT: หนึ่งร้อยยี่สิบสามบาทถ้วน
console.log(toBahtTextThai(55.36)); // OUTPUT: ห้าสิบห้าบาทสามสิบหกสตางค์

console.log(toBahtText(123, "en")); // OUTPUT: One hundred Twenty Three Baht Only
console.log(toBahtTextEnglish(123)); // OUTPUT: One hundred Twenty Three Baht Only
console.log(toBahtTextEnglish(55.36)); // OUTPUT: Fifty Five Baht and Thirty Six Satang
```

- Nothing else

## Installation

```bash
# NPM
npm install --save @n0uur/thaibaht-text

# Yarn
yarn add @n0uur/thaibaht-text

# PNPM
pnpm add @n0uur/thaibaht-text
```

## License

This project is licensed under the [MIT License](LICENSE)

## Acknowledgements

- [to-words](https://www.npmjs.com/package/to-words) - Converts numbers into words
- [bahttext](https://www.npmjs.com/package/bahttext) - Converts numbers into Thai words

Thanks to the creators of the 'to-words' and 'bahttext' packages for providing the foundational tools used in this project.

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
npm package: @n0xgg04/cptit-submit
Description: (by n0xgg04)
Author: n0xgg04
Latest version: 1.0.1

# CODE PTIT SUBMIT
(by n0xgg04)

> ## Này để làm gì?
> À, khi làm code ptit, có phải bạn phải save file, sau đó qua trang code ptit nộp và chờ kết quả có phải không?
>Nếu bạn thấy điều này bình thường, không quá nhọc thì tool này không dành cho bạn... Tool này giúp bạn submit code lên codeptit chỉ cần code bạn có dòng đầu tiên chứa mã bài và tên code có chứa ``main``. Ví dụ ``main.py``, ``main.java``

#### Ví dụ:
``main.py``

```py
#PY10123

...code 
```

Để nộp code, bạn chỉ cần
```bash
npx cptit-submit
```

Lần đầu sử dụng, tool sẽ yêu cầu bạn cung cấp thông tin đăng nhập. Đăng nhập vào thôi!

Nếu trong kỳ học, bạn có hơn 1 môn code, bạn sẽ cần chọn khoá (course) để tool biết sẽ nộp vào môn học nào. Sử dụng mũi tên lên xuống trên bàn phím để lựa chọn, ấn ``Enter`` để xác nhận.

Kiểu:
```
? Select target course:
  Default: Học kỳ 1 năm học 2024 - 2025
❯ Lập trình hướng đối tượng - Nhóm 12
  Lập trình với Python - Nhóm 08
  Thuật toán và ứng dụng nâng cao - Nhóm THUẬT TOÁN NÂNG CAO - 2024
```

Oke và chờ kết quả thôi... Ví dụ:
```
Login to B22DCCN021...!
COURSE: Lập trình với Python - Nhóm 08
⠙ Submiting PY01005...
⠇ Submiting PY01005...
Submited PY01005
┌──────────┬────────────────────┬───────────────┬──────────┬──────────┬──────────┬──────────┬───────────────┐
│ Problem  │ Problem Name       │ Date          │ Time     │ Result   │ Memory   │ Run Time │ Compiler      │
├──────────┼────────────────────┼───────────────┼──────────┼──────────┼──────────┼──────────┼───────────────┤
│ PY01005  │ SỐ MAY MẮN         │ 2024-09-02    │ 23:42:58 │ IR       │ 9388Kb   │ 0.03s    │ Python 3      │
└──────────┴────────────────────┴───────────────┴──────────┴──────────┴──────────┴──────────┴───────────────┘
```

Từ lần 2, nếu muốn submit bài đó tiếp, chỉ cần ấn mũi tên lên ở terminal và ấn Enter, tool sẽ khi nhớ môn học, và chỉ hỏi lại khi bạn ``reset`` để đổi môn.

### Chọn lại course:
Chạy lệnh:
```bash
npx cptit-submit -c
```

### Đăng nhập tài khoản khác :
Chạy lệnh:
```bash
npx cptit-submit -r
```

Code hơi bẩn do tớ bận vler, rảnh rảnh code cho vui thôi nên đừng soi làm gì:))
npm package: @n123al/oraclesql
Description: Connect to an Oraclesql-SQL server and run queries using a simple API
Author: Nick
Latest version: 0.1.6

# Connect to an Oracle-SQL server and run queries using a simple API

A simple way to run SQL queries using Async/Await and Promises. This is not an ORM.  
It uses node-mssql under the hood

## Installation

```bash
npm install @n123al/oraclesql
```

## initialization

```typescript
import { SqlConfig, sqlInit } from '@n123al/oraclesql';
const sqlConfig: SqlConfig = {
    user: 'sa',
    password: 'password',
    server: 'localhost',
    database: 'AdventureWorks'
};
sqlInit(sqlConfig);
```

## Usage

> The first parameter is the SQL query to execute. Use @P1, @P2 for parameter values.
> the rest parameters are the values for the parameters (The first one will replace @P1, the second will replace @P2 and so on)

```typescript
import { sql } from '@n123al/oraclesql';
sql
    .query('SELECT * FROM USERS WHERE name like @P1 AND isActive = @P2', 'John%', true)
    .then(data => console.log(data))
    .catch(error => console.error(error));
```

### using Async / Await

```typescript
try {
    const data = await sql.query('SELECT * FROM USERS WHERE name like @P1 AND isActive = @P2', 'John%', true);
} catch (error) {
    console.log(error);
}
```

### Methods

*   sql.query (alias: sql.q): Executes query and returns an array with the results. Can be used for any query types
*   sql.queryOne (alias: sql.1): Executes the query and returns the first record, or null if there are no records
*   sql.insertReturnIdentity (alias: sql.ii): Can be used for INSERT. It will return the identity of the inserted record (i.e. SCOPE_IDENTITY()) or null