iowriteblast
v1.4.2
Published
IOWriteBlast is a tiny helper for Input, Output, and Text Animation for both Node and the Browser!
Maintainers
Readme
iowriteblast
A tiny helper library for input, output, and text animations — for both Node and the browser!
✨ Features
📝 Writing Animation
WriteAnimation(text, speed)has an optional speed, can be emptyWriteAnimationBrowser(element, text, speed)Creates a typing effect.speedandelementare optional — leave them null to use defaults.
Defaults: Speed = 110ms, Element = h2
📤 Output Helpers
IO.Print(text)IO.Print_ln(text)
Simple output with or without a newline.
🎧 Input Helpers
IO.Read(question, callback)IO.ReadReturn(question)
Shows an optional question, then if it is IO.Read(), it runs callback(answer) when the user types something, and IO.ReadReturn() returns the value the user types
📱💻🌐 Cross-platform
- Supports both CJS (CommonJS) and ESM (ECMAscript Modules / ES Modules)
- Supports older JS versions
✨️ What's New
- Bug fixes
- Improved compatibility
🚀 Installation
- npm install iowriteblast
Examples
📥 Input:
import { IO } from "iowriteblast";
IO.Read("What's your name? ", (name) => {
IO.Print_ln(`Hello, ${name}`)
});📥 Input (return, requires await):
import { IO } from "iowriteblast";
async function main() {
const name = await IO.ReadReturn("What's your name? ");
IO.Print_ln(`Hello, ${name}!`);
}
main();✏️ Writing Animation (Console)
import { WriteAnimation } from "iowriteblast";
// Using async/await
await WriteAnimation("Hello, IOWriteBlast!", 90);📤 Output
import { IO } from "iowriteblast";
IO.Print_ln("Hello, IOWriteBlast!")🌐 Website Writing Animation
import { WriteAnimationBrowser } from "iowriteblast";
const h1Element = document.querySelector("h1");
WriteAnimationBrowser(h1Element, "Hello, IOWriteBlast!", 90);