open-index/open-npm huggingface dataset:
npm package: @jumpaku/async-result
Description: A typescript library that provides Result, Option, and AsyncResult.
Author: Jumpaku
Latest version: 1.4.0

# AsyncResult

A typescript library that provides `Result` and `AsyncResult`.

- `Result<V, E>` represents a result of a computation.

  - It has a value of the type `V` if the computation is succeeded.
  - It has an error of the type `E` if the computation is failed.

- `AsyncResult<V, E>` represents an asynchronous result of a computation.
  - It is implemented as a wrapper of `Promise<Result<V, E>>`.
  - It takes one of the three kinds of states:
    1. Pending: the computation has not been completed.
    2. Succeeded: the computation succeeded with a value.
    3. Failed: the computation failed by an error.

## Examples

- [examples/index.ts](examples/index.ts)

## API

- Result: [dist/Result.d.ts](dist/Result.d.ts)
- AsyncResult: [dist/AsyncResult.d.ts](dist/AsyncResult.d.ts)

## Contribution

### Commit massages

- feat
- build
- fix
- docs

https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines

### Development

#### Build

```sh
git clone https://github.com/Jumpaku/AsyncResult.git
cd AsyncResult
npm install
npm run test
```

#### Publish

```sh
npm run build
npm run test
npm version minor
npm publish --access public
```
npm package: @jumpaku/export-dotenv
Description: Script that supports to pass environment variables defined by dotenv file to `env` command.
Author: Jumpaku
Latest version: 2.0.4

# export-dotenv-docker

Docker image that supports to pass environment variables defined by dotenv file to `env` command.

## Using docker image

### Load default .env

The `.env` is loaded if the file is mounted to `/dotenv/.env` or the parent directory of the file is mounted to `/dotenv`.

```sh
echo 'ABC=xyz' > .env
env $(docker run -v $(pwd):/dotenv jumpaku/export-dotenv-docker) sh -c 'echo ${ABC}'
# => xyz
```

```sh
echo 'ABC=xyz' > .env.example
env $(docker run -v $(pwd)/.env.example:/dotenv/.env jumpaku/export-dotenv-docker) sh -c 'echo ${ABC}'
# => xyz
```

### Load specified dotenv file

The specified dotenv file is loaded if an ancestor directory of the file is mounted to `/dotenv`.

```sh
echo 'ABC=xyz' > .env.example
env $(docker run -v $(pwd):/dotenv jumpaku/export-dotenv-docker .env.example) sh -c 'echo ${ABC}'
# => xyz
```

### Load .env included in specified directory

The `.env` in the specified directory is loaded if an ancestor directory of the directory is mounted to `/dotenv`.

```sh
mkdir -p example
echo 'ABC=xyz' > example/.env
env $(docker run -v $(pwd):/dotenv jumpaku/export-dotenv-docker example) sh -c 'echo ${ABC}'
# => xyz
```

## Using script

### Install:

```sh
npm install -g @jumpaku/export-dotenv
```

### Usage:

```sh
export-dotenv [<dotenv-or-dir-including-dotnev>]
```

### Options:

*  `-h`, `--help`  display help for command

### Examples


```sh
# The `./.env` is loaded.
echo 'ABC=xyz' > .env
env $(export-dotenv) sh -c 'echo ${ABC}'
# => xyz
```

```sh
# The specified dotenv file is loaded.
echo 'ABC=xyz' > .env.example
env $(export-dotenv .env.example) sh -c 'echo ${ABC}'
# => xyz
```


```sh
# The `.env` in the specified directory is loaded.
mkdir -p example
echo 'ABC=xyz' > example/.env
env $(export-dotenv example) sh -c 'echo ${ABC}'
# => xyz
```