JSPM

jetty

0.2.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 185
  • Score
    100M100P100Q77148F
  • License BSD

TTY, you so fly

Package Exports

  • jetty

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jetty) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Jetty

TTY, you so fly.

Overview

Jetty gives you a nice interface to working with ANSI control sequences. If you need a full-blown terminal UI toolkit, you probably want something like curses.

Installation

Available via npm:

$ npm install jetty

Or via git:

$ git clone git://github.com/fknsrs/jetty.git
$ cd jetty
$ npm install

Usage

// Yeah, Jetty!
var Jetty = require("jetty");

// Create a new Jetty object. This is a through stream with some additional
// methods on it. Additionally, connect it to process.stdout
var jetty = new Jetty(process.stdout);

// Clear the screen
jetty.clear();

// Draw a circle with fly colours
var i = 0;
setInterval(function() {
  i += 0.025;

  var x = Math.round(Math.cos(i) * 25 + 50),
      y = Math.round(Math.sin(i) * 13 + 20);

  jetty.rgb(
    Math.round(Math.random() * 215),
    Math.random() > 0.5
  ).moveTo([y,x]).text(".");
}, 5);

License

3-clause BSD. A copy is included with the source.

Contact