open-index/open-npm huggingface dataset:
npm package: @iipekolict/wormhole
Description: Library for handle backend state between middlewares in Express / Express-based frameworks
Author: Evgenii Scherbakov
Latest version: 1.0.6
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Wormhole
TypeScript library for handle backend state between middlewares in Express / Express-based frameworks using Request object

# Installation

```shell
npm install @iipekolict/wormhole
```

# Usage

Configuring dynamic wormhole based on initial state object (highly recommended)

```typescript
import { WormholeService, DynamicWormholeClass } from '@iipekolict/wormhole';

type State = {
  todos: object[];
  posts: object[];
  missing?: boolean;
};

// initial state object
const state: State = {
  todos: [],
  posts: [],
};

// create dynamic wormhole class with utility methods based on initial state object
const Wormhole: DynamicWormholeClass<State> = WormholeService.create(state);
```

Then use it inside middlewares and endpoints for set / get state fields

```typescript
import { WormholeService, DynamicWormhole, DynamicWormholeClass } from '@iipekolict/wormhole';
import express, { Request, Response, NextFunction } from 'express';
import { fetchTodos } from 'project'

// ...previous example

const app = express();

app.use(async (request: Request, response: Response, next: NextFunction) => {
  const wormhole: DynamicWormhole<State> = new Wormhole(request);
  const todos: object[] = await fetchTodos();
  
  wormhole.set({ todos }); // set todos field in backend state
  wormhole.setTodos(todos); // same as previous, method generates dynamically based on initial state object
  next();
});

app.use(async (request: Request, response: Response, next: NextFunction) => {
  const wormhole: DynamicWormhole<State> = new Wormhole(request);
  
  console.log(wormhole.get('todos')); // [...todos]
  console.log(wormhole.getTodos()); // [...todos]
  console.log(wormhole.get('posts')); // []
  console.log(wormhole.getPosts()); // []
  
  next();
});

app.get('/', async (request: Request, response: Response, next: NextFunction) => {
  // wormhole factory, same as new Wormhole()
  const wormhole: DynamicWormhole<State> = WormholeService.getInstance<State>(request);
  
  console.log(wormhole.get('missing')); // undefined
  
  response.json({ todos: wormhole.getTodos() });
});

app.listen(5000);
```

Creating custom setter

```typescript
const wormhole: DynamicWormhole<State> = new Wormhole(request);

const setter = wormhole.createSetter((state: State, todo: object) => {
  return { todos: [...state.todos, todo] };
});

setter({ text: 'some text' });
```

Creating custom spread setter

```typescript
const wormhole: DynamicWormhole<State> = new Wormhole(request);

const spreadSetter = wormhole.createSpreadSetter((state: State, ...posts: Post[]) => {
  return { posts: [...state.posts, ...posts] };
});

spreadSetter({ text: 'some text' }, { text: 'another text' });
```

# Examples

[Express](https://github.com/IIPEKOLICT/libraries/blob/main/typescript/wormhole/examples/express/index.ts)
npm package: @iistools/account
Description: Manage IIS identity, API keys, and sessions
Latest version: 0.3.0

# @iistools/account

CLI for managing your IIS identity, API keys, and sessions.

## Installation

```bash
npm install -g @iistools/account
```

## Quick Start

```bash
# Create an account
iis-account register

# Log in
iis-account login

# Check your identity
iis-account whoami

# Create an API key
iis-account keys create --name "my-app"

# List your keys
iis-account keys list
```

## Commands

| Command | Description |
|---------|-------------|
| `register` | Create a new IIS account |
| `login` | Log in to your IIS account |
| `logout` | Log out and clear local credentials |
| `whoami` | Show your identity and plan |
| `keys create` | Create a new API key |
| `keys list` | List your API keys |
| `keys revoke <id>` | Revoke an API key |
| `keys rotate <id>` | Rotate an API key |
| `plan` | Show your current plan and entitlements |
| `usage` | Show usage breakdown by service |
| `status` | Check connectivity to the IIS account service |
| `verify <token>` | Verify your email address |

## Configuration

| Variable | Default | Description |
|----------|---------|-------------|
| `IIS_ACCOUNT_URL` | `https://account.iis.tools` | API endpoint |

## Credential Storage

Credentials are stored securely:

- **Refresh tokens** are kept in your OS keychain when available (macOS Keychain, Windows Credential Manager, or libsecret on Linux)
- Falls back to `~/.iis/credentials.json` with restricted file permissions (`0600`)

## Requirements

- Node.js >= 24

## License

MIT