open-index/open-npm huggingface dataset:
npm package: @jiminp/lite-fs
Description: A simple fs-like API wrapper of IndexedDB for light application usage.
Author: Jimin Park
Latest version: 0.1.1

# lite-fs

A simple fs-like API wrapper of IndexedDB for light application usage.

> [!WARNING]
> This library is currently work-in-progress, and it's for personal use.

## Installation

```bash
pnpm i @jiminp/lite-fs
```

## Usage

```ts
import { LiteFS } from "@jiminp/lite-fs";

// Write a text file
const fs = new LiteFS('my-app-fs');
await fs.writeFile("/hello.txt", "Hello, world!");

// Read as string
const text = await fs.readFile("/hello.txt", 'utf-8');
console.log(text); // "Hello, world!"
```

### Path Rules

- All paths **must be absolute** (start with `/`).
- Folder paths end with `/`, file paths do not.
- Empty segments (`//`) are not allowed.
- `.` and `..` segments are not allowed in paths.

For handling relative paths, use `joinPath` exported by this library.
npm package: @jiminp/sd-prompt-parser
Description: Library for parsing prompts for Stable Diffusion.
Author: Jimin Park
Latest version: 0.1.3

# sd-prompt-parser

![npm](https://img.shields.io/npm/v/@jiminp/sd-prompt-parser?style=flat-square)
![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/123jimin/sd-prompt-parser/build.yaml?branch=main&style=flat-square)

`sd-prompt-parser` is a simple JS library for parsing Stable Diffusion prompts with custom syntax.

The syntax is designed to be used on frontends with one text input.

## API

```js
import { parse, split, stringify } from 'sd-prompt-parser';

const prompt = "tag1, -tag2, -(tag3, -tag4) <lora:lora1> <custom:modifiers>";

// AST of the prompt above
// IMPORTANT: `parse` may throw.
const parsed_prompt = parse(prompt);

// AST of positive and negative prompts
const [parsed_pos, parsed_neg] = split(parsed_prompt);

// "tag1, (tag4)<lora:lora1><custom:modifiers>"
console.log(stringify(parsed_pos));

// "tag2, (tag3)<lora:lora1><custom:modifiers>"
console.log(stringify(parsed_neg));

// "tag1, (tag4)<lora:lora1>(custom modifier: custom, modifiers)"
console.log(stringify(parsed_pos, {
    modifierHandler(args) {
        // Supported return types:
        // - `string[]`: the arguments of the modifier is substituted.
        // - `string`: the modifier is substituted to the string.
        // - `null` and `undefined`: removed.
        if(args[0] === 'lora') return args;
        return `(custom modifier: ${args.join(', ')})`;
    }
}));
```

## Syntax

### Simple tags

```text
tag1, tag2, -tag3, -tag4, tag5
```

This translates to:

- Positive: `tag1, tag2, tag5`
- Negative: `tag3, tag4`

### Attentions

```text
(tag1, -tag2), -(tag3, -tag4), (tag5, -tag6, (tag7): 2)
```

This translates to:

- Positive: `(tag1), (tag4), (tag5, (tag7):2)`
- Negative: `(tag2), (tag3), (tag6:2)`

### Modifiers

```text
<lora:name1:weight1> -<custom:name2:weight2>
```

This translates to:

- Positive: `<lora:name1:weight1>`
- Negative: `<custom:name2:weight2>`
npm package: @jiminp/smolt
Description: A smol and simple JavaScript template engine for personal projects.
Author: Jimin Park
Latest version: 0.2.0

# smolt

[![NPM Version](https://img.shields.io/npm/v/%40jiminp%2Fsmolt)](https://www.npmjs.com/package/@jiminp/smolt) ![GitHub License](https://img.shields.io/github/license/123jimin/smolt)

smolt is a smol and simple JavaScript template engine.

smolt aims to achieve smol code size.

**smolt has smol security, as smolt uses `eval` for compiling templates!**

smolt is only suitable for smol JavaScript projects where all templates can be trusted.

## Installation

```sh
npm install @jiminp/smolt
```

## Usage

```js
import { makeTemplate } from smolt;

const f = makeTemplate("{{#if name}}Hello, {{toUpper(name)}}!{{#else}}Who are you?{{#endif}}");

// Prints "Hello, SMITH!".
console.log(f({
    name: "Smith",
    toUpper: (name) => name.toUpperCase(),
}));

// Prints "Who are you?".
console.log(f());

// Prints "Who are you?" (calls `f.toString()`).
console.log(`${f}`);

```

smolt has a smol api.

```ts
type SmoltTemplate = (args?: Record<string, unknown>) => string;

// Uses `eval` to compile the source.
function makeTemplate(template_src: string): SmoltTemplate;

// Returns the source code, which can be `eval`-d to obtain a template function.
function toTemplateSrc(template_src: string): string;
```

## Grammar

smolt has a smol grammar.

```text
{{ctx_var}}
{{ctx_func(arg1, arg2, arg3, ...)}}
{{ctx_var + ctx_var}}
{{"prefix" + ctx_var + "postfix"}}
```

smolt has smol intelligence, and assumes all variables are from the context.

smolt makes you avoid this issue by doing the following.

```text
{{= ctx.ctx_var}}
{{= ctx.ctx_func(arg1, arg2, arg3, ...)}}
{{= Math.random()}}
{{= ... any arbitrary JavaScript expression (scary!) }}
```

smolt has branches, but no loops yet.

```text
{{#if ctx_var == "foo"}}var is foo{{#elif ctx_var == "baz"}}var is baz{{#endif}}
```

smolt has comments.

```text
Hello,
{{// owo}}
world!
```

smolt removes a line that only contains comments or null values; the below template gives `Hello,\nfalse\nworld!`.

```text
Hello,
{{null}}{{undefined}}
{{// uwu}}
{{= false}}
world!
```
npm package: @jiminp/tooltool
Description: Simple Utility Library for TypeScript
Author: Jimin Park
Latest version: 0.3.1

# tooltool

This library provides various small utilities for TypeScript projects.

Currently, tooltool is my personal utility library, and no backward compatibility is guaranteed.

## Features

- No dependencies!
- Supports both Node.js (22+) and modern web browsers.

## Usage

```bash
npm install @jiminp/tooltool
```

To see which utilities are available, [check the documentation](https://123jimin.github.io/tooltool).
npm package: @jimizai/bytes
Description: bytes is a crate for tranform js string to bytes
Author: jimizai
Latest version: 1.0.3

### bytes

This library can easily and quickly convert js string to bytes

### install

Install bytes using yarn:

```shell
yarn add @jimizai/bytes -S
```

Install bytes using npm

```shell
npm i @jimizai/bytes -S
```

### usage

```js
import { b } from "@jimizai/bytes";
const bytes = b`hello wolrd`;
// => Uint8Array(11) [
//   104, 101, 108, 108,
//   111,  32, 119, 111,
//   108, 114, 100
// ]
```