
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
nodejs-ansibuffer
Advanced tools
nodejs-ANSIBuffer is a chunked, escape code aware input/output buffer for use in BBS-like telnet programs. It's primary use it to provide a factory to mimic the delay that we were all used to in the old BBS days.
var net = require('net');
var ansi = require('nodejs-ansibuffer');
var server = net.createServer(function(c) { //'connection' listener
console.log('server connected');
var outputBuffer = new ansi.ANSIBuffer();
var delayedWriter = setInterval(
function() {
var tmp = outputBuffer.bite();
if ( tmp !== false ) { c.write(tmp); }
}, 15);
// Set character mode (client side - do not wait for CR-LF)
c.write(String.fromCharCode(255) + String.fromCharCode(253) + String.fromCharCode(34),'ascii');
// No local (client-side) echo
c.write(String.fromCharCode(255) + String.fromCharCode(251) + String.fromCharCode(1),'ascii');
outputBuffer.queue(" `9W`1elcome `9T`1o `9ANSIB`1uffer `2!!");
});
server.listen(8124, function() { //'listening' listener
console.log('server bound');
});
To create a new buffer, import the module, and create a new ANSIBuffer() object.
var ansi = require('nodejs-ansibuffer');
var buffer = new ansi.ANSIBuffer();
Returns the full contents of the buffer, while emptying it.
Returns an inteligent "chunk" of the buffer, of variable length. Great pains are taken to never "break" an ANSI control sequence - odd things happen when there is a manufactured delay in these - well, sometimes anyway.
Empty the buffer, drop all the contents.
Queue text for display. This can be plain text, a string containing full escape codes, or a string containing "Legend of the Red Dragon" backtick codes.
Queue text for display (same as above) - But center it on an 80 column screen. If not specified, defaults to a TERM width of 80.
This is an object that contains some well-used high-ASCII characters, reimagined in unicode.
This is a function that allows you to center an ANSI string prior to queueing it.
This is a function that allows you to right-align an ANSI string prior to queueing it. Column can be either "absolute" (default), or based on the rest of the line.
a/n: Absolute method moves to the named column, then backs up the length of the string. Relative method "spaces" over that many columns, then backs up the length of the string.
These are the backtick color codes based on how the Legend of the Red Dragon did things.
Note the lack of dark grey. This is an issue with the default colors on the mac terminal. (taken from iTerm - terminal.app is even worse)

Taken in terminator. gnome-terminal is comparable

This module is in a development stage. It's probably broken horribly in places - not sure.
This module was only tested using node >= 0.8.8. There is no reason it shouldn't run under earlier versions though.
node-ansibuffer is licensed under the MIT license. Or the BSD license. Or no license if that's more convient for you.
FAQs
Escape code aware (ANSI), chunked, input/output buffer
We found that nodejs-ansibuffer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.