An open API service indexing awesome lists of open source software.

https://github.com/ultirequiem/deno-clear

🧽 Utilities to clean the console + CLI App
https://github.com/ultirequiem/deno-clear

console deno denoland typescript

Last synced: about 2 months ago
JSON representation

🧽 Utilities to clean the console + CLI App

Awesome Lists containing this project

README

          

# Clear

[![GitMoji](https://img.shields.io/badge/Gitmoji-%F0%9F%8E%A8%20-FFDD67.svg)](https://gitmoji.dev)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
![Lines Of Code](https://img.shields.io/tokei/lines/github.com/UltiRequiem/fibonacci-deno?color=blue&label=Total%20Lines)
![CodeQL](https://github.com/UltiRequiem/fibonacci-deno/workflows/CodeQL/badge.svg)

Port of [node-clear](https://github.com/bahamas10/node-clear) with some extras.

> Clear the terminal if possible.

You can get this package by [nest.land](https://nest.land/package/clear) or
[deno.land](https://deno.land/x/clear).

## Usage

This package exposes two Functions,
[clear](https://github.com/UltiRequiem/deno-clear/blob/main/mod.ts#L1) (as
default) and
[delayedClear](https://github.com/UltiRequiem/deno-clear/blob/main/mod.ts#L7).

```typescript
import { clear, delayedClear } from "https://deno.land/x/clear/mod.ts";

console.log("Some Text...");

clear();

console.log("I will be erased in 5 seconds.");

delayedClear(5000);
```

Check the [cli tool](./cli.ts) for more usage examples.

### CLI Tool

This project contains a cli tool, it is made to give an example of use mainly.

#### Install it

```bash
deno install -n declear https://deno.land/x/clear/cli.ts
```

For more info check [this](https://deno.land/manual/tools/script_installer).

You can also get a binary from
[releases](https://github.com/UltiRequiem/deno-clear/releases/latest).

#### Usage

- If you just run the command, it will clear your console:

```bash
$ declear
```

- Full Clear:

```bash
$ declear --full
```

- Delayed Clear:

```bash
$ declear --delay 3
```

- You can combine the two flags:

```bash
declear --delay 4 --full
```

- If you need help:

```bash
declear --help
Options:
--full Full Clean
--delay Seconds to delay
--help Print this
For more help check https://github.com/UltiRequiem/deno-clear
```

### License

[This package](https://deno.land/x/fibonacci) is licensed under the
[MIT License](./LICENSE.md).