1.1.1 ā€¢ Published 2 years ago

pageterm v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago
PageTerm displays file content in a terminal

Installation

npm install pageterm -g

Demo

PageTerm Demo


Usage

CLI

$> pageterm [options] <filepath>

--

Programmatically CommonJs

const {showHelp} = require("pageterm");

--

Programmatically ESM

import {showHelp} from "pageterm";

Examples

const displayHelpFile = async function ()
{
    const content = fs.readFileSync("./my-help-file", "utf-8");
    await showHelp(content, {
        windowTitle: "My Application Name - Help ā”",
        topText: "Press CTRL + C or Q to Quit | Page Down or Any key to scroll down",
        topTextBg: "",
        topTextReversed: true,
        colorify: true
    });
};

filepath File path to content to show


Arguments

$> pageterm <filepath>

filepath File path to content to show


Options:

OptionsDescriptionDefault
-v, --versionoutput the current version
-m, --markdownDisplay file content with partial Markdown supporttrue
-c, --colorifyDisplay file content with colorsfalse
-c, --colorifyDisplay file content with colorsfalse
-p, --progressShow progress bartrue
-s, --smoothEnable smooth scrollingtrue
-s, --latencyScrollSmooth scrolling latency10
-t, --windowTitleSet text in Terminal title bar
--topTextChange the top menu text
-h, --helpdisplay help for command

Package

šŸ“ package                
ā”‚
ā””ā”€ā”€ā”€šŸ“ cjs
ā”‚   ā”‚ šŸ“ index.cjs               ā‡½ CJS version      - Node (9.6kB unminified)
ā””ā”€ā”€ā”€šŸ“ dist
ā”‚   ā”‚ šŸ“ index.mjs               ā‡½ ESM version      - Node (9.7kB unminified)

Changelog

current:
  • Display entire help without interruption when TTY is not available
1.1.0:
  • Display help with PageTerm
  • Update code for the ESM file
1.0.5:
  • Restore the initial color on quitting
  • Display content left on quitting
  • Fix lines wrapped incorrectly
1.0.4:
  • Don't display the top text when the console display is wide enough.