tootallnate / ansi.js Goto Github PK
View Code? Open in Web Editor NEWAdvanced ANSI formatting tool for Node.js
License: MIT License
Advanced ANSI formatting tool for Node.js
License: MIT License
I'm thinking of using this module on one of my personal projects. Just wondering if this has been tested on windows?
The telnet client only sees the text and no colors.
http://pastebin.com/R9kyjVjB
It would be great to have a new release with the LICENSE file and the license information in the package.json.
Thanks!
I realize that the code https://github.com/TooTallNate/ansi.js/blob/master/examples/starwars.js is siimply connecting to a server and streaming the bits it gets, however my legal team won't let me ship that file as it poses a potential legal issue.
You might want to consider removing this example. OR replacing it with something that is ok to use.
http://oreilly.com/pub/h/4441 outlines how to use mplayer to create ASCII movies. From here you just need to find a CreativeCommons or similar clip you can recode.
I cloned the repo, and run
npm install
The end of log:
ERR! [email protected] preinstall: node-waf configure build
ERR! cmd "/c" "node-waf configure build"
failed with 1
ERR!
ERR! Failed at the [email protected] preinstall script.
ERR! This is most likely a problem with the canvas package,
ERR! not with npm itself.
ERR! Tell the author that this fails on your system:
ERR! node-waf configure build
ERR! You can get their info via:
ERR! npm owner ls canvas
ERR! There is likely additional logging output above.
ERR!
ERR! System Windows_NT 6.1.7600
ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install"
ERR! cwd D:\Git\ansi.js
ERR! node -v v0.6.18
ERR! npm -v 1.1.21
ERR! code ELIFECYCLE
ERR! message [email protected] preinstall: node-waf configure build
ERR! message cmd "/c" "node-waf configure build"
failed with 1
ERR! errno {}
For some reason process.stderr is undefined in this case, you know why this is happening? It just suddenly started to happen. Node version is 0.10.34.
Could we get a handler on if its undefined?
var ansi = require('ansi')
log.cursor = ansi(process.stderr)
function ansi (stream, options) {
if (stream._ansicursor) {
return stream._ansicursor
} else {
return stream._ansicursor = new Cursor(stream, options)
}
}
module.exports = exports = ansi
Hi,
i have high doubts about the right to distribute yoshi.png in ansi.js.
Do you have the license to ? or a link to the license applying to that file ?
I hope you understand why i raise that issue -- better now than too late...
Jérémy.
This code has some interesting behavior on powershell:
var ansi = require('ansi');
var ansiLogger = ansi(process.stderr);
ansiLogger.fg.red();
ansiLogger.bg.grey();
ansiLogger.write('colored output\n').reset();
Now, in ConEmu (my terminal of choice on Windows), this works fine:
However, if I use powershell.exe by itself, the colors don't reset properly:
See how the BG of all the text emitted afterwards is black? I discovered this originally from a bug logged to npm
.
Is it possible to go to the end of the line? Like:
cursor
.gotoEndOfLine(row)
.fg.green()
.write('Done');
The title says it all, thanks :)
Is this possible with ansi
package?
Are there any plans to make this 'use strict' compatible?
Currently you use octal literals which are being deprecated.
Hello Nate!
I am trying to do the reverse of what you tool does - take stdout/err logs (with window size info and timestamps of when things were printed to the terminal) and "play" them back in a < pre >.
The hard part it would seem, is interpreting the ANSI escape codes.
Do you know of any project that has done this? If not, may I use some of your code to do it?
Thank you so much!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.