open-index/open-npm huggingface dataset:
npm package: @jikyo/romaji
Description: A converter library to romanize Japanese hiragana/katakana string by standard and IME typing styles.
Author: Junnosuke Moriya
Latest version: 0.0.1

# @jikyo/romaji

`romaji` is a converter library to romanize Japanese hiragana/katakana string by standard and IME typing style.
There exists several different romanization systems, so one hiragana/katakana string has so many romanize string.
For example, "ちゃ" can be romanized as "cha", "tya", "chixya", "tixya", "chilya", or "tilya".
`romaji` provides romanized strings as many as possible.

If an input string contained non hiragana/katakana characters (includes kanji), `romaji` return the characters as same as the input.
For example, `romaji` converts the input "お茶の水" to "o茶no水".
If there is a need to romanize the whole string which includes kanji, `romaji` can romaize the readings in the tokens which [kuromoji.js](https://www.npmjs.com/package/kuromoji) tokenizer provides.
`romaji` strongly recommends to use with [kuromoji.js](https://www.npmjs.com/package/kuromoji).

The mapping from hiragana/katakana to romaji is based on common IME's system to input Japanese.
Therefor, `romaji` does not directly implement the standard system like Hepburn, Nihon-shiki or Kunrei-shiki, but includes them.

## Note

**Note:** `romaji` only support **UTF-8** encoding.

## Installation

```sh
npm i @jikyo/romaji
```

## Usage

```js
const romaji = require('@jikyo/romaji');
romaji('僕ドラえもん'); // [僕doraemon, 僕doraemon', 僕doraemonn]
romaji('金閣寺'); // []
```

## License

[MIT](LICENSE)
npm package: @jil/args
Description: A convention based argument parsing and formatting library, with strict validation checks
Author: TY
Latest version: 0.2.0

# @jil/args

> A convention based argument parsing and formatting library, with strict validation checks. It _is not_ a command line
> interface.

```ts
import {parse} from '@jil/args';

interface Options {
  help: boolean;
  logLevel: 'info' | 'error' | 'warn';
  version: boolean;
}

const {command, errors, options, params, rest} = parse<Options>(process.argv.slice(2), {
  commands: ['build', 'install', 'update'],
  options: {
    help: {
      default: false,
      description: 'Show a help menu',
      type: 'boolean',
      short: 'H',
    },
    logLevel: {
      choices: ['info', 'error', 'warn'],
      default: 'info',
      description: 'Customize logging level',
    },
    version: {
      default: false,
      description: 'Show the version number',
      type: 'boolean',
      short: 'V',
    },
  },
});
```

## Features

- Commands and sub-commands: `cmd`, `cmd:sub`
- Options (long and short) that set a value(s): `--foo value`, `--foo=value`, `-f value`, `-f=value`
  - Camel (preferred) or kebab cased option names.
- Flags (boolean options) that take no value: `--bar`, `-B`
  - With implicit negation support: `--no-bar`
- Parameters that act as standalone values: `foo bar baz`
  - Can be marked as required.
- Rest arguments that are passed to subsequent scripts (aggregated after `--`): `foo -- bar`
- Supports `string`, `number`, `boolean`, and list based values, with the addition of:
  - Single value based on a list of possible choices.
  - Multiple values with optional arity count requirements.
- Group multiple short options under a single argument: `-fBp`
  - Increment a counter each time a short option is found in a group.
- Strict parser and validation checks, allowing for informative interfaces.
  - Custom option and param validation for increased accuracy.

## Installation

```
npm i @jil/args
```

## Documentation

- [https://boostlib.dev/docs/args](https://boostlib.dev/docs/args)
- [https://boostlib.dev/api/args](https://boostlib.dev/api/args)
npm package: @jil/backoff
Description: A utility that allows retrying a function with an exponential delay between attempts.
Author: TY
Latest version: 0.3.0

# @jil/backoff

> A utility that allows retrying a function with an exponential delay between attempts.

## Installation

```
npm i @jil/backoff
```

## Usage

The `backoff<T>` function takes a promise-returning function to retry, and an optional `BackfofOptions` object. It
returns a `CancelablePromise<T>`.

```ts
declare function backoff<T>(
  runner: (token: CancellationToken) => Promise<T>,
  options?: BackoffOptions,
): CancelablePromise<T>;
```

Here is an example retrying a function that calls a hypothetical weather endpoint:

```ts
import {backoff} from '@jil/backoff';

function getWeather() {
  return fetch('weather-endpoint');
}

async function main() {
  try {
    const response = await backoff(() => getWeather());
    // process response
  } catch (e) {
    // handle error
  }
}

main();
```

Example for cancelation

```ts
import {backoff} from '@jil/backoff';

function getWeather(token: CancellationToken) {
  const request = fetch('weather-endpoint');
  token.onCancellationRequested(() => request.abort());
  return request;
}

async function main() {
  try {
    const request = backoff(() => getWeather());
    setTimeout(() => request.cancel(), 2000);
    // process response
  } catch (e) {
    // handle error
    // if canceld, a CanceledError throws
  }
}

main();
```

## BackoffOptions

- `strategy?: BackoffStrategyType | BackoffStrategyCtor`

  Specify the strategy type or strategy class. Built in strategies are `exponential` and `fibonacci`.

  Defaults to `fibonacci`

- `jitter?: JitterType | Jitter`

  Decides whether a [jitters](https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/) should be
  applied to the delay. Possible values are `full` and `none`.

  Defaults to `none`

- `initialDelay?: number`

  The delay, in milliseconds, before executing the function for the first time.

  Defaults to 100

- `maxDelay?: number`

  The maximum delay, in milliseconds, between two consecutive attempts.

  Defaults to Infinity, must be greater than initialDelay

- `maxNumOfAttempts?: number`

  The maximum number of times to attempt the function.

  Defaults to 10

- `factor?: number`

  The exponential factor. The `initialDelay` is multiplied by the `factor` to increase the delay between reattempts.

  Defaults to 2, must be greater than 1

- `delayFirstAttempt?: boolean`

  Decides whether the `initialDelay` should be applied before the first call. If `false`, the first call will occur
  without a delay.

  Defaults to false

- `retry?: (e: any, attemptNumber: number) => ValueOrPromise<any>`

  The `retry` function can be used to run logic after every failed attempt (e.g. logging a message, assessing the last
  error, etc.). It is called with the last error and the upcoming attempt number. Returning `true` will retry the
  function as long as the `numOfAttempts` has not been exceeded. Returning `false` will end the execution.

  Defaults to return ture always
npm package: @jil/bufio
Description: Buffer and serialization utilities for javascript
Author: TY
Latest version: 0.2.0

# @jil/bufio

> Buffer and serialization utilities for javascript
>
> This project is TypeScript version from [bufio](https://github.com/bcoin-org/bufio)

## Usage

```js
import * as bio from '@jil/bufio';

const bw = bio.write();
bw.writeU64(100);
bw.writeString('foo');
const data = bw.render();

const br = bio.read(data);
assert(br.readU64() === 100);
assert(br.readString(3) === 'foo');
```

## Struct Usage

```js
import * as bio from '@jil/bufio';

class MyStruct extends bio.Struct {
  constructor() {
    super();
    this.str = 'hello';
    this.value = 0;
  }

  write(bw) {
    bw.writeVarString(this.str, 'ascii');
    bw.writeU64(this.value);
    return this;
  }

  read(br) {
    this.str = br.readVarString('ascii');
    this.value = br.readU64();
    return this;
  }
}

const obj = new MyStruct();

console.log('Buffer:');
console.log(obj.encode());

console.log('Decoded:');
console.log(MyStruct.decode(obj.encode()));

console.log('Hex:');
console.log(obj.toHex());

console.log('Decoded:');
console.log(MyStruct.fromHex(obj.toHex()));

console.log('Base64:');
console.log(obj.toBase64());
```

## License

- Copyright (c) 2020-2022, Yuan Tao (MIT License).
- Copyright (c) 2017, Christopher Jeffrey (MIT License).
npm package: @jil/cli
Description: An interactive command line program builder, powered by React and Ink
Author: TY
Latest version: 0.2.0

# @jil/cli

> An interactive command line program builder, powered by [React][react] and [Ink][ink].

```ts
import {Program} from '@jil/cli';
import BuildCommand from './commands/Build';
import CleanCommand from './commands/Clean';

const program = new Program({
  bin: 'jil',
  name: 'Jil',
  version: '1.2.3',
});

program.register(new BuildCommand());
program.register(new CleanCommand());

await program.runAndExit(process.argv);
```

## Features

- Supports common [argument features][args] like commands, options, flags, parameters, and more.
- Export a stand-alone or command-based CLI program binary.
- Write declarative commands with decorators, or imperative commands with static properties.
- Write shorthand proxy commands for small one offs.
- Renders interface using [React][react] and [Ink][ink] at 16 FPS, or output simple strings.
- Outputs beautiful help, usage, error, and index menus.
- Buffers console logs to avoid render tearing.
- Apply middleware to the argv list, or to the parsed arguments.
- Customize output colors using Jil-based terminal themes.

## Installation

```
npm i @jil/cli react
```

## Documentation

- [https://boostlib.dev/docs/cli](https://boostlib.dev/docs/cli)
- [https://boostlib.dev/api/cli](https://boostlib.dev/api/cli)
npm package: @jil/common-node
Description: A common utilities and helpers for Node.js
Author: TY
Latest version: 0.2.2
Deprecated: Package renamed to @jil/ncommon

# @jil/common-node

> A common utilities and helpers for Node.js
>
> Forked from [@boost/common](https://boostlib.dev/docs/common)

```ts
import {Path} from '@jil/common-node';
```

## Installation

```shell
npm i @jil/common-node
```

## Documentation

- [https://boostlib.dev/docs/common](https://boostlib.dev/docs/common)
- [https://boostlib.dev/api/common](https://boostlib.dev/api/common)
npm package: @jil/config
Description: Powerful convention based finder, loader, and manager of both configuration and ignore files.
Author: TY
Latest version: 0.4.0

# @jil/config

> Powerful convention based finder, loader, and manager of both configuration and ignore files.

```ts
import {Blueprint, Schemas} from '@jil/common/optimal';
import {Configuration} from '@jil/config';

interface ConfigFile {
  debug: boolean;
  sourceMaps: boolean;
}

class ConfigManager extends Configuration<ConfigFile> {
  blueprint({bool}: Schemas): Blueprint<ConfigFile> {
    return {
      debug: bool(),
      sourceMaps: bool(),
    };
  }
}

const configManager = new ConfigManager('jil');

// Load `.config/jil.js`, `jil.production.json`, `.jil.yaml`, etc
const {config} = await configManager.loadConfigFromRoot('.');

// Load `.jilignore` files
const ignore = await configManager.loadIgnoreFromBranchToRoot('./some/deep/path');
```

## Features

- Loads root configs (`.config/<name>.js`) and branch configs (`.<name>.js`).
- Loads ignore files (`.<name>ignore`).
- Supports multiple config types: `js`, `cjs`, `mjs`, `json`, `yaml`
- Supports environment and root-level based overrides.
- Supports extending from other config files.
- Find files within each branch folder while traversing up the tree.
- Caches finder results for increased efficiency.
- Custom key-value setting processors.

## Installation

```
npm i @jil/config
```

## Documentation

- [https://boostlib.dev/docs/config](https://boostlib.dev/docs/config)
- [https://boostlib.dev/api/config](https://boostlib.dev/api/config)
npm package: @jil/decorators
Description: Experimental decorators for common patterns
Author: TY
Latest version: 0.3.0

# @jil/decorators

> Experimental decorators for common patterns.
>
> Forked from [@boost/decorators](https://boostlib.dev/docs/decorators)

```ts
import {bind} from '@jil/decorators/bind';
import {memoize} from '@jil/decorators/memoize';

class Example {
  @bind()
  referencedMethod() {
    return this; // Class instance
  }

  @memoize()
  someExpensiveOperation() {
    // Do something heavy
  }
}
```

## Features

- `@bind` - Auto-bind a method's `this` to the class context.
- `@debounce` - Defer the execution of a method in milliseconds.
- `@deprecate` - Mark a property, method, or class as deprecated.
- `@memoize` - Cache and return the result of a method execution.
- `@throttle` - throttle the execution of a method to a timeframe in milliseconds.

## Installation

```
npm i @jil/decorators
```

## Documentation

- [https://jillib.dev/docs/decorators](https://jillib.dev/docs/decorators)
- [https://jillib.dev/api/decorators](https://jillib.dev/api/decorators)
npm package: @jil/log
Description: Lightweight level based logging system
Author: TY
Latest version: 0.2.0

# @jil/log

> Lightweight level based logging system

```ts
import {createLogger} from '@jil/log';

const log = createLogger();

log('Something has happened…');
```

## Features

- Isolated logger instances.
- Supports 6 logging levels, in order of priority: log, trace, debug, info, warn, error.
- Handles default and max logging levels.
- Customizable transports with writable streams.
- Toggleable logging at runtime.

## Installation

```
npm i @jil/log
```

## Documentation

- [https://boostlib.dev/docs/log](https://boostlib.dev/docs/log)
- [https://boostlib.dev/api/log](https://boostlib.dev/api/log)
npm package: @jil/module
Description: Module resolving and loading utilities with TypeScript support.
Author: TY
Latest version: 0.3.0

# @jil/module

> Load and resolve custom file types at runtime with a more powerful Node.js `require` replacement.

```ts
import {requireModule} from '@jil/module';

const result = requireModule('./some/non-js/file.ts');
```

## Features

- CommonJS based importing with `requireModule()`
- CommonJS interoperability with ESM-like files
- ECMAScript module based importing with a custom ESM loader
- Supported file types: TypeScript (`.ts`, `.tsx`)

## Installation

```
npm i @jil/module
```

## Documentation

- [https://boostlib.dev/docs/module](https://boostlib.dev/docs/module)
- [https://boostlib.dev/api/module](https://boostlib.dev/api/module)
npm package: @jil/ncommon
Description: A common utilities and helpers for Node.js
Author: TY
Latest version: 0.3.0

# @jil/ncommon

> A common utilities and helpers for Node.js
>
> Forked from [@boost/common](https://boostlib.dev/docs/common)

```ts
import {Path} from '@jil/ncommon';
```

## Installation

```shell
npm i @jil/ncommon
```

## Documentation

- [https://boostlib.dev/docs/common](https://boostlib.dev/docs/common)
- [https://boostlib.dev/api/common](https://boostlib.dev/api/common)
npm package: @jil/phonenumber
Description: An utility for validating the phone number for security purposes
Author: TY
Latest version: 0.2.0

# @jil/phonenumber

> A utility for validating the phone number for security purposes

## Introduction

Validate and format a phone number.

Uses [google-libphonenumber](https://github.com/ruimarinho/google-libphonenumber) for validation.

Which is a compiled version of the Google library [libphonenumber](https://github.com/googlei18n/libphonenumber).

## Usage

```typescript
import {phoneValidator} from '@jil/phonenumber';

console.log(phoneValidator.validate('18511223344', {defaultCountry: 'CN'}));
// => '18511223344'
console.log(phoneValidator.validate('18511223344', {defaultCountry: 'CN', format: 'e164'}));
// => '+8618511223344'
console.log(phoneValidator.validate('18511223344', {defaultCountry: 'CN', format: 'international'}));
// => '+86 185 1122 3344'
console.log(phoneValidator.validate('18511223344', {defaultCountry: 'CN', format: 'national'}));
// => '+86 185 1122 3344'
console.log(phoneValidator.validate('18511223344', {defaultCountry: 'CN', format: 'rfc3966'}));
// => '185 1122 3344'
console.log(phoneValidator.validate('494322456', {defaultCountry: 'CN'}));
// => validation error: PhoneNumberValidationError
```

or create a new validator with multiple default countries:

```typescript
import {PhoneNumberValidator} from '@jil/phonenumber';

const validator = PhoneNumberValidator.create({defaultCountry: ['CN', 'US']});

console.log(validator.validate('18511223344'));
// => '18511223344'
console.log(validator.validate('18511223344', {format: 'e164'}));
// => '+8618511223344'
```
npm package: @jil/pipeline
Description: Pipe an input through a series of routines and tasks to produce an output, or simply, run logic in a series of stages
Author: TY
Latest version: 0.2.0

# @jil/pipeline

> Pipe an input through a series of routines and tasks to produce an output, or simply, run logic in a series of stages

<!-- prettier-ignore -->
```ts
import { Context, WaterfallPipeline } from '@jil/pipeline';

const ast = new WaterfallPipeline(new Context(), filePath)
  .pipe('Parsing AST', parseAst)
  .pipe('Linting rules', runLintsOnAst)
  .pipe('Transforming nodes', transformNodesOnAst)
  .pipe('Writing contents', writeAstToFile)
  .run();
```

## Features

- Parallel and serial based processing pipelines.
- Supports 2 types of work units: tasks and routines.
- Pooling and aggregated implementations for computation heavy or complex logic.
- Contextually aware executions.

## Installation

```
npm i @jil/pipeline
```

## Documentation

- [https://boostlib.dev/docs/pipeline](https://boostlib.dev/docs/pipeline)
- [https://boostlib.dev/api/pipeline](https://boostlib.dev/api/pipeline)
npm package: @jil/plugin
Description: Plugin based architecture that supports module loading, custom types, registries, scopes, and more.
Author: TY
Latest version: 0.2.0

# @jil/plugin

> Plugin based architecture that supports module loading, custom types, registries, scopes, and more.

```ts
import {Registry, Pluggable} from '@jil/plugin';

export interface Renderable<T> extends Pluggable<T> {
  render(): string | Promise<string>;
}

const registry = new Registry<Renderable>('jil', 'plugin', {
  validate(plugin) {
    if (typeof plugin.render !== 'function') {
      throw new TypeError('Plugins require a `render()` method.');
    }
  },
});

const plugin = await registry.load('jil-plugin-example');
```

## Features

- Custom plugin types and registries.
- Node module, file path, and configuration file loading strategies.
- Multiple module name formats: public, scoped public, scoped private.
- Structural contracts with life cycle events.
- Factory function pattern for plugin creation.
- Asynchronous by default.

## Installation

```
npm i  @jil/plugin
```

## Documentation

- [https://boostlib.dev/docs/plugin](https://boostlib.dev/docs/plugin)
- [https://boostlib.dev/api/plugin](https://boostlib.dev/api/plugin)
npm package: @jil/retimer
Description: A reschedulable setTimeout library for JavaScript
Author: TY
Latest version: 0.2.0

# @jil/retimer

> A reschedulable setTimeout library for JavaScript. This library is built for building a keep alive functionality
> across a large numbers of clients/sockets.
>
> Forked from [retimer](https://github.com/mcollina/retimer)

## Install

```
npm install @jil/retimer --save
```

## Example

```ts
import {retimer} from '@jil/retimer';

const timer = retimer(() => {
  throw new Error('this should never get called!');
}, 20);

setTimeout(() => {
  timer.reschedule(50);
  setTimeout(() => {
    timer.clear();
  }, 10);
}, 10);
```

## API

### retimer(runner, timeout, ...args)

Exactly like your beloved `setTimeout`. Returns a `Retimer object`

### timer.reschedule(timeout)

Reschedule the timer. Retimer will not gove any performance benefit if the specified timeout comes **before** the
original timeout.

### timer.clear()

Clear the timer, like your beloved `clearTimeout`.

## How it works

Timers are stored in a Linked List in node.js, if you create a lot of timers this Linked List becomes massive which
makes **removing a timer an expensive operation**. Retimer let the old timer run at its time, and schedule a new one
accordingly, when the new one is **after** the original timeout. There is no performance gain when the new timeout is
before the original one as retimer will just **remove the previous timer**.

## License

MIT
npm package: @jil/terminal
Description: A collection of utilities for managing and interacting with a terminal
Author: TY
Latest version: 0.2.0

# @jil/terminal

> A collection of utilities for managing and interacting with a terminal

## Installation

```
npm i @jil/terminal
```

## Documentation

- [https://boostlib.dev/docs/terminal](https://boostlib.dev/docs/terminal)
- [https://boostlib.dev/api/terminal](https://boostlib.dev/api/terminal)
npm package: @jil/theme-moon-dark
Description: Dark Side of the Moon command line theme for Boost powered CLIs.
Latest version: 2.1.2

# DSOTM Theme - Boost

[Dark Side of the Moon](https://github.com/thierryc/dark-side-of-the-moon-syntax) command line theme for Boost powered
CLIs. Ideal for dark terminals.

```bash
npm install @jil/theme-moon-dark --dev
```
npm package: @jil/theme-moon-light
Description: Far Side of the Moon command line theme for Boost powered CLIs.
Latest version: 2.1.2

# FSOTM Theme - Boost

[Far Side of the Moon](https://github.com/thierryc/far-side-of-the-moon-syntax) command line theme for Boost powered
CLIs. Ideal for light terminals.

```bash
npm install @jil/theme-moon-light --dev
```
npm package: @jil/theme-one-dark
Description: One Dark command line theme for Boost powered CLIs.
Latest version: 2.1.2

# One Dark Theme - Boost

[One Dark](https://github.com/atom/atom/tree/master/packages/one-dark-ui) command line theme for Boost powered CLIs.
Ideal for dark terminals.

```bash
npm install @jil/theme-one-dark --dev
```
npm package: @jil/theme-one-light
Description: One Light command line theme for Boost powered CLIs.
Latest version: 2.1.2

# One Light Theme - Boost

[One Light](https://github.com/atom/atom/tree/master/packages/one-light-ui) command line theme for Boost powered CLIs.
Ideal for light terminals.

```bash
npm install @jil/theme-one-light --dev
```
npm package: @jil/theme-solarized
Description: Solarized command line theme for Boost powered CLIs.
Latest version: 2.1.2

# Solarized Theme - Boost

[Solarized](http://ethanschoonover.com/solarized) command line theme for Boost powered CLIs. Ideal for dark terminals.

```bash
npm install @jil/theme-solarized --dev
```
npm package: @jil/translate
Description: Package and application level translations made easy
Author: TY
Latest version: 0.2.0

# @jil/translate

> Package and application level translations made easy. Wraps the powerful
> [i18next](https://www.npmjs.com/package/i18next) library to abstract complexity away and define common server-side
> settings.

```ts
import {createTranslator} from '@jil/translate';

const msg = createTranslator(['common', 'errors'], '../path/to/resources');

msg('common:welcome', {name: 'Jil'}); // Hello Jil!
```

## Features

- Isolated translator instances.
- Namespace aware resource bundles.
- Automatic locale detection, from command line options, or from the operating system.
- Supports multiple file types: JavaScript, JSON, YAML.
- Message interpolation, pluralization, nesting, and more.
- Plus all other features found in [i18next](https://www.i18next.com/)!

## Installation

```
npm i @jil/translate
```

## Documentation

- [https://boostlib.dev/docs/translate](https://boostlib.dev/docs/translate)
- [https://boostlib.dev/api/translate](https://boostlib.dev/api/translate)
npm package: @jil/types
Description: A basic TypeScript types library
Author: TY
Latest version: 0.2.3
Deprecated: Package combined to @jil/common. Use @jil/common instead

# @jil/types

> A basic TypeScript types library

## Install

```sh
npm install --save-dev @jil/types
```

## What's inside?

- [Install](#Install)
- Types
  - All TypeScript types from [ts-essential](https://github.com/krzkaczor/ts-essentials) expect any functions(`assert`
    and `noop` functions moved into [tily](https://www.npmjs.com/package/tily))
  - [Constructor](#Constructor)
  - [ValueOrPromise](#ValueOrPromise)
  - [MixinTarget](#MixinTarget)

### Constructor

A class constructor accepting arbitrary arguments.

**signature**

```ts
export declare type Constructor<T> = new (...args: any[]) => T;
```

### ValueOrPromise

Representing a value or promise. This type is used to represent results of synchronous/asynchronous resolution of
values.

**signature**

```ts
export type ValueOrPromise<T> = T | PromiseLike<T>;
```

### MixinTarget

A replacement for typeof Target to be used in mixin class definitions. This is a workaround for TypeScript limitation
described in:

- https://github.com/microsoft/TypeScript/issues/17293
- https://github.com/microsoft/TypeScript/issues/17744
- https://github.com/microsoft/TypeScript/issues/36060

```ts
export function MyMixin<T extends MixinTarget<Application>>(superClass: T) {
  return class extends superClass {
    // contribute new class members
  };
}
```