
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
terminal-next
Advanced tools
--- Next gen terminal helper, slim, extensible, easy to use. Fully promise based, callbacks are not a thing anymore. Some widgets do not support non-tty terminals.
Next gen terminal helper, slim, extensible, easy to use. Fully promise based, callbacks are not a thing anymore. Some widgets do not support non-tty terminals.
Zero dependencies.
Node v14+, cannot run in browser
For yarn:
yarn add terminal-next
For npm:
npm i terminal-next
either compile them or use ts-node to execute immediately

import { Terminal } from 'terminal-next';
// optionally pass stdin and/or stdout, if not provided
// process.stdin and process.stdout will be used
const t = new Terminal();
t.red('Red text').newline();
// fully customizable text output
t.text('Some text', {fg: 'cyan', bg: 'red', dim: true});
Typical text input prompt

import { Terminal, TextInput } from 'terminal-next';
const t = new Terminal();
// you can use promises instead of await
(async () => {
const ti = new TextInput(t, 'Your name?');
const answ = await ti.start();
t.text(answ);
})();
Simple yes/no confirmation

import { Terminal, Confirm } from 'terminal-next';
const t = new Terminal();
(async () => {
const ti = new Confirm(t, 'Super?');
const answ = await ti.start();
t.text(answ.toString()).newline();
})();
Single option select widget

import { Terminal, Select } from 'terminal-next';
const t = new Terminal();
(async () => {
const options = [
{title: 'Option 1', value: '111'},
{title: 'Option 2', value: '222'},
{title: 'Some other option', value: '333'},
];
const select = new Select(t, options);
const result = await select.start();
t.text('answer: ' + result);
})();
Spinner with a text

import { Terminal, Spinner } from 'terminal-next';
const t = new Terminal(process.stdout, process.stdin);
(async () => {
const spinner = new Spinner(t, 'test');
// you define tick rate yourself or just tick whenever a progress is made
const itv = setInterval(async () => {
await spinner.draw();
}, 100);
setTimeout(()=> {
clearInterval(itv);
}, 3000);
})();

import { Terminal, ProgressBar } from 'terminal-next';
const t = new Terminal();
(async () => {
const pb = new ProgressBar(t, 100);
await pb.draw();
let prog = 0;
const itv = setInterval(async () => {
await pb.setProgress(prog);
prog++;
if (prog > 100) {
clearInterval(itv);
// important, in order to stop terminal from flickering,
// show cursor after this is done
t.showCursor();
}
}, 50);
})();

import { Terminal, Table } from 'terminal-next';
const t = new Terminal();
(async () => {
t.clear();
const data = [
['id', 'name', 'email', 'active', 'banned'],
['1', 'Marian', 'mtest@tst.com', 'true', 'false'],
['2', 'Adam', 'adam@gmail.com', 'true', 'true'],
['3', 'Gertruda', 'g.rtruda@wp.pl', 'false', 'false']
];
const table = new Table(t);
table.setData(data);
table.draw();
})();
You can either construct them yourself or make PR if you think there is a widget that is really important to have. Either way, create issue in this project.
FAQs
--- Next gen terminal helper, slim, extensible, easy to use. Fully promise based, callbacks are not a thing anymore. Some widgets do not support non-tty terminals.
We found that terminal-next demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.