Skip to main content
Deno 2 is finally here 🎉️
Learn more

Clear

GitMoji License: MIT Lines Of Code CodeQL

Port of node-clear with some extras.

Clear the terminal if possible.

You can get this package by nest.land or deno.land.

Usage

This package exposes two Functions, clear (as default) and delayedClear.

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

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

clear();

const delay = 5;

console.log("I will be erased in %d seconds.", delay);

delayedClear(delay);

Check the cli tool for more usage examples.

CLI Tool

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

Install it

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

For more info check this.

You can also get a binary from releases.

Usage

  • If you just run the command, it will clear your console:
$ declear
  • Full Clear:
$ declear --full
  • Delayed Clear:
$ declear --delay 3
  • You can combine the two flags:
declear --delay 4 --full
  • If you need help:
declear --help
Options:
  --full    Full Clean
  --delay   Delay the Console Cli
  --help    Print this
For more help check https://github.com/UltiRequiem/deno-clear

License

This package is licensed under the MIT License.