Giter Site home page Giter Site logo

cloudxtreme / press-enter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bertrandom/press-enter

0.0 1.0 0.0 301 KB

BBS-style ANSI color enter prompts for Node.js modules or the CLI

Home Page: https://www.npmjs.com/package/press-enter

JavaScript 100.00%

press-enter's Introduction

press-enter

BBS-style ANSI color enter prompts for Node.js modules or the CLI

image

There are 9 animated prompts and 6 static prompts.

The animated prompts were ported from an old PCBoard PPE (EPE1PWA.ZIP) originally released on February 17, 1994, a little over twenty years ago.

image

The static prompts were extracted from the default install of Iniquity BBS software v1.01, released on July 26, 1997.

image

Here's are the prompts in use in their corresponding software:

Animated prompt in PCBoard

image

Static prompt in Iniquity

image

Static prompts:

image

Installation

npm install -g press-enter

Usage

To use press-enter, your terminal must support ANSI colors with bright settings. I use iTerm2 with the Report Terminal Type setting at xterm-256color and colors set to the Dark Background preset.

CLI usage

press-enter [style] [color]
  style: 0-13
  color: red, yellow, green, blue, cyan, magenta, grey

For example, if you want to use the 4th prompt in Red, you can type

press-enter 4 red

or specify that in your shell scripts.

0-8 are animated prompts, 9-13 are static.

Running press-enter by itself will default to the 3rd style in the color blue.

Node usage

You can use press-enter anywhere where you want to control flow. The callback fires after the user presses enter.

pressEnter([options], callback)

Options is an optional hash, you can omit it:

var pressEnter = require('press-enter');

pressEnter(function() {
	process.exit();
});
Option Description
style Style from 0-13, 0-8 are animated, 9-13 are static
color red, yellow, green, blue, cyan, magenta, grey. Defaults to blue.
centered Whether or not to try to detect the number of columns in the terminal and center the prompt. Defaults to true.
input Node.js stream, defaults to stdin
output Node.js stream, defaults to stdout

Example specifying options:

var pressEnter = require('press-enter');

pressEnter({style: 3, color: red}, function() {
	process.exit();
});

License

MIT

press-enter's People

Contributors

bertrandom avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.