open-index/open-npm huggingface dataset:
npm package: @navyk/opentui-core
Description: opentui-core renderables for navyk, a focus-based keyboard navigation system.
Latest version: 0.1.5

# @navyk/opentui-core

`opentui-core` renderables for `navyk`, a focus-based keyboard navigation system.

## Install

```bash
bun add @navyk/opentui-core
```

## What this package provides

- `TargetRenderable`: base focusable node with focus/focus-within lifecycle
- `ScopeRenderable`: keymap-driven focus routing to descendants by id
- `CellRenderable`: scope node with local focus semantics for grids
- `GridRenderable`: 2D local navigation and focus recovery helpers

## Focus model

- `focus`: active focused node (what receives key events)
- `focusWithin`: ancestor chain of the active focus
- `focusLocal`: local selection inside a `GridRenderable`
- `focusCurrentFocusLocal`: optional bridge from grid focus to focused local cell

## Minimal example

```ts
import { createCliRenderer } from "@opentui/core";
import {
    CellRenderable,
    GridRenderable,
    ScopeRenderable,
    type MovementKeymaps,
} from "@navyk/opentui-core";

const renderer = await createCliRenderer();

const movement: MovementKeymaps = {
    overflowBehavior: "stop",
    left: { name: "left" },
    right: { name: "right" },
    up: { name: "up" },
    down: { name: "down" },
};

const app = new ScopeRenderable(renderer, {
    id: "app",
    defaultFocus: "main-grid",
    width: "100%",
    height: "100%",
    targets: {
        "main-grid": { name: "escape" },
    },
});

const grid = new GridRenderable(renderer, {
    id: "main-grid",
    size: [2, 2],
    movement,
    focusCurrentFocusLocal: true,
    width: "100%",
    height: "100%",
});

for (let i = 0; i < 4; i += 1) {
    grid.add(
        new CellRenderable(renderer, {
            id: `cell-${i}`,
            width: "50%",
            height: "50%",
        }),
    );
}

app.add(grid);
renderer.root.add(app);
app.focus();
```
npm package: @navyk/opentui-react
Description: @opentui/react bindings for the @navyk/opentui-core package.
Latest version: 0.1.5

# @navyk/opentui-react

`@opentui/react` bindings for the `@navyk/opentui-core` package.

## Install

```bash
bun add @navyk/opentui-core @navyk/opentui-react @opentui/react @opentui/core react
```

## Setup

Import the package once during app bootstrap. This registers `grid`, `cell`, `scope`, and `target` as OpenTUI components for React.

```ts
import "@navyk/opentui-react";
```

## Minimal usage

```tsx
import "@navyk/opentui-react";

const movement = {
    overflowBehavior: "stop",
    left: { name: "left" },
    right: { name: "right" },
    up: { name: "up" },
    down: { name: "down" },
} as const;

export function App() {
    return (
        <scope id="app" defaultFocus="menu-grid">
            <grid
                id="menu-grid"
                size={[2, 2]}
                movement={movement}
                focusCurrentFocusLocal
                style={{ width: "100%", height: "100%" }}
            >
                <cell id="a" style={{ width: "50%", height: "50%" }} />
                <cell id="b" style={{ width: "50%", height: "50%" }} />
                <cell id="c" style={{ width: "50%", height: "50%" }} />
                <cell id="d" style={{ width: "50%", height: "50%" }} />
            </grid>
        </scope>
    );
}
```
npm package: @navyk/opentui-solid
Description: @opentui/solid bindings for the @navyk/opentui-core package.
Latest version: 0.1.5

# @navyk/opentui-solid

`@opentui/solid` bindings for the `@navyk/opentui-core` package.

## Install

```bash
bun add @navyk/opentui-core @navyk/opentui-solid @opentui/solid @opentui/core solid-js
```

## Setup

Import the package once during app bootstrap. This registers `grid`, `cell`, `scope`, and `target` as OpenTUI components for Solid.

```ts
import "@navyk/opentui-solid";
```

## Minimal usage

```tsx
import "@navyk/opentui-solid";

const movement = {
    overflowBehavior: "stop",
    left: { name: "left" },
    right: { name: "right" },
    up: { name: "up" },
    down: { name: "down" },
} as const;

export function App() {
    return (
        <scope id="app" defaultFocus="menu-grid">
            <grid
                id="menu-grid"
                size={[2, 2]}
                movement={movement}
                focusCurrentFocusLocal
                style={{ width: "100%", height: "100%" }}
            >
                <cell id="a" style={{ width: "50%", height: "50%" }} />
                <cell id="b" style={{ width: "50%", height: "50%" }} />
                <cell id="c" style={{ width: "50%", height: "50%" }} />
                <cell id="d" style={{ width: "50%", height: "50%" }} />
            </grid>
        </scope>
    );
}
```
npm package: @nawb/fs
Description: TODO
Author: Your Name
Latest version: 0.0.1

# nawb-fs

## Getting started

`$ npm install nawb-fs --save`

### Mostly automatic installation

`$ react-native link nawb-fs`

## Usage
```javascript
import NawbFs from 'nawb-fs';

// TODO: What to do with the module?
NawbFs;
```
npm package: @nawb/net
Description: TODO
Author: Your Name
Latest version: 1.0.0

# nawb-path

## Getting started

`$ npm install nawb-path --save`

### Mostly automatic installation

`$ react-native link nawb-path`

## Usage
```javascript
import NawbPath from 'nawb-path';

// TODO: What to do with the module?
NawbPath;
```
npm package: @nawb/os
Description: TODO
Author: Your Name
Latest version: 1.0.0

# nawb-path

## Getting started

`$ npm install nawb-path --save`

### Mostly automatic installation

`$ react-native link nawb-path`

## Usage
```javascript
import NawbPath from 'nawb-path';

// TODO: What to do with the module?
NawbPath;
```
npm package: @nawb/path
Description: TODO
Author: Your Name
Latest version: 1.0.0

# nawb-path

## Getting started

`$ npm install nawb-path --save`

### Mostly automatic installation

`$ react-native link nawb-path`

## Usage
```javascript
import NawbPath from 'nawb-path';

// TODO: What to do with the module?
NawbPath;
```
npm package: @nawb/thread
Description: TODO
Author: Your Name
Latest version: 1.0.0

# nawb-path

## Getting started

`$ npm install nawb-path --save`

### Mostly automatic installation

`$ react-native link nawb-path`

## Usage
```javascript
import NawbPath from 'nawb-path';

// TODO: What to do with the module?
NawbPath;
```
npm package: @naweak/n
Description: Simple WebAPI Framework
Author: naweak
Latest version: 1.0.0

# n-framework

## Install to your project

```bash
npm i @naweak/n -S
```

## Use in your project

```js
const Framework = require('@naweak/n')
const app = new Framework({
  methodsDir: __dirname + '/src/methods/', // Your API methods dir
  host: '127.0.0.1', // Your project hostname
  port: 3000 // Your project port
})
app.runServer()
```

## Create methods

### Successful response

```js
// src/methods/exampleSuccessMethod.js
// Demonstrates successful response
const Response = require('@naweak/n/lib/response')

module.exports = {
  /**
   * @param {object} params - HTTP request params
   * @param {string} ip - Client IP address
   */
  run(params, ip) {
    return new Response({
      message: 'Hello world!',
      params,
      ip
    })
  }
}
```

```bash
$ curl "http://127.0.0.1:3000/api/?method=exampleSuccessMethod&test=123"
```

```json
{
  "success": {
    "message": "Hello world!",
    "params": {
      "method": "exampleSuccessMethod",
      "test": "123"
    },
    "ip": "127.0.0.1"
  }
}
```

### Error response

```js
// src/methods/exampleErrorMethod.js
// Demonstrates error response
const ErrorResponse = require('@naweak/n/lib/error')

module.exports = {
  run() {
    return new ErrorResponse(
      'Failed', // Error data
      11 // Error code
    )
  }
}
```

```bash
$ curl "http://127.0.0.1:3000/api/?method=exampleErrorMethod"
```

```json
{
  "error": {
    "data": "Failed",
    "code": 11
  }
}
```

## Custom routes

```js
// You can use express middlewares
app.app.use('/', (req, res) => {
  res.send('Hello world!')
})
```

```bash
$ curl "http://127.0.0.1:3000/"
Hello world!
```