[Pkg-javascript-commits] [node-ansi] 01/09: Imported Upstream version 0.3.0
Jérémy Lal
kapouer at moszumanska.debian.org
Thu Jul 31 11:35:42 UTC 2014
This is an automated email from the git hooks/post-receive script.
kapouer pushed a commit to branch master
in repository node-ansi.
commit e4068ee0fa5063b41f4d2097f9a61d82d1e7b165
Author: Jérémy Lal <kapouer at melix.org>
Date: Thu Jul 31 12:28:43 2014 +0200
Imported Upstream version 0.3.0
---
.jshintrc | 4 ++++
History.md | 16 ++++++++++++++++
README.md | 15 +++++++++++----
examples/starwars.js | 46 ----------------------------------------------
package.json | 39 ++++++++++++++++++++-------------------
5 files changed, 51 insertions(+), 69 deletions(-)
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..248c542
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,4 @@
+{
+ "laxcomma": true,
+ "asi": true
+}
diff --git a/History.md b/History.md
new file mode 100644
index 0000000..f4a9fe3
--- /dev/null
+++ b/History.md
@@ -0,0 +1,16 @@
+
+0.3.0 / 2014-05-09
+==================
+
+ * package: remove "test" script and "devDependencies"
+ * package: remove "engines" section
+ * pacakge: remove "bin" section
+ * package: beautify
+ * examples: remove `starwars` example (#15)
+ * Documented goto, horizontalAbsolute, and eraseLine methods in README.md (#12, @Jammerwoch)
+ * add `.jshintrc` file
+
+< 0.3.0
+=======
+
+ * Prehistoric
diff --git a/README.md b/README.md
index 2f9bb14..6ce1940 100644
--- a/README.md
+++ b/README.md
@@ -7,9 +7,6 @@ writing ANSI escape codes to `Stream` instances. ANSI escape codes are used to d
fancy things in a terminal window, like render text in colors, delete characters,
lines, the entire window, or hide and show the cursor, and lots more!
-The code for the example in the screenshot above can be found in the
-`examples/imgcat` directory.
-
#### Features:
* 256 color support for the terminal!
@@ -51,7 +48,7 @@ cursor
// Rendering modes are persistent:
cursor.hex('#660000').bold().underline()
-// You can use the regular logging functions, text will be green
+// You can use the regular logging functions, text will be green:
console.log('This is blood red, bold text')
// To reset just the foreground color:
@@ -59,6 +56,16 @@ cursor.fg.reset()
console.log('This will still be bold')
+// to go to a location (x,y) on the console
+// note: 1-indexed, not 0-indexed:
+cursor.goto(10, 5).write('Five down, ten over')
+
+// to clear the current line:
+cursor.horizontalAbsolute(0).eraseLine().write('Starting again')
+
+// to go to a different column on the current line:
+cursor.horizontalAbsolute(5).write('column five')
+
// Clean up after yourself!
cursor.reset()
```
diff --git a/examples/starwars.js b/examples/starwars.js
deleted file mode 100644
index 06f8ba8..0000000
--- a/examples/starwars.js
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * A little script to play the ASCII Star Wars, but with a hidden cursor,
- * since over `telnet(1)` the cursor remains visible which is annoying.
- */
-
-process.title = 'starwars'
-
-var net = require('net')
- , cursor = require('../')(process.stdout)
- , color = process.argv[2]
-
-// enable "raw mode" so that keystrokes aren't visible
-process.stdin.resume()
-if (process.stdin.setRawMode) {
- process.stdin.setRawMode(true)
-} else {
- require('tty').setRawMode(true)
-}
-
-// connect to the ASCII Star Wars server
-var socket = net.connect(23, 'towel.blinkenlights.nl')
-
-socket.on('connect', function () {
- if (color in cursor.fg) {
- cursor.fg[color]()
- }
- cursor.hide()
- socket.pipe(process.stdout)
-})
-
-process.stdin.on('data', function (data) {
- if (data.toString() === '\u0003') {
- // Ctrl+C; a.k.a SIGINT
- socket.destroy()
- process.stdin.pause()
- }
-})
-
-process.on('exit', function () {
- cursor
- .show()
- .fg.reset()
- .write('\n')
-})
diff --git a/package.json b/package.json
index 8625a68..721c2bd 100644
--- a/package.json
+++ b/package.json
@@ -1,20 +1,21 @@
-{ "name": "ansi"
-, "description": "Advanced ANSI formatting tool for Node.js"
-, "keywords": [ "ansi", "formatting", "cursor", "color", "terminal", "rgb", "256", "stream" ]
-, "version": "0.2.1"
-, "author": "Nathan Rajlich <nathan at tootallnate.net> (http://tootallnate.net)"
-, "repository": { "type": "git", "url": "git://github.com/TooTallNate/ansi.js.git" }
-, "main": "./lib/ansi.js"
-, "bin": {
- "beep": "./examples/beep/index.js"
- , "clear": "./examples/clear/index.js"
- , "starwars": "./examples/starwars.js"
- }
-, "scripts": {
- "test": "mocha --reporter spec"
- }
-, "devDependencies": {
- "mocha": "*"
- }
-, "engines": { "node": "*" }
+{
+ "name": "ansi",
+ "description": "Advanced ANSI formatting tool for Node.js",
+ "keywords": [
+ "ansi",
+ "formatting",
+ "cursor",
+ "color",
+ "terminal",
+ "rgb",
+ "256",
+ "stream"
+ ],
+ "version": "0.3.0",
+ "author": "Nathan Rajlich <nathan at tootallnate.net> (http://tootallnate.net)",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/TooTallNate/ansi.js.git"
+ },
+ "main": "./lib/ansi.js"
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-ansi.git
More information about the Pkg-javascript-commits
mailing list