@apochromat/print
Dynamic text output for interactive command line apps.
Installation
npm install @apochromat/print --save
Usage
import {Lens} from 'apochromat';
import {print} from '@apochromat/print';
const greeting = new Lens();
const salutation = new Lens();
const subject = new Lens();
print(greeting);
salutation.render`Hi`;
subject.render`everyone`;
greeting.render`${salutation}, ${subject}!`;
setTimeout(() => subject.render`world`, 1000);
setTimeout(() => salutation.render`Hello`, 2000);
Hi, everyone!
Hi, world!
Hello, world!
Types
function print(lens: Lens, stream: WriteStream = process.stdout): () => void;
Copyright 2021 Clemens Akens. All rights reserved.
MIT license.