A Javascript library for typewriter animations
TypewriterJS is a promise-based virtual typewriter that offers an easy and hackable way of producing and maintaining typewriter-like animations on text, basic stuff like typing, deleting and moving the cursor around are only at the command of a method call.
npm install eo-typewriterjsbower install eo-typewriterjsyarn add eo-typewriterjshttps://cdn.jsdelivr.net/npm/eo-typewriterjs@latest/dist/typewriter.jsDownload the latest version from here. Download a specific version from here.
The following is only applicable starting from version 4.0.0.
- Navigate to the
distfolder inside of the downloaded package. - Copy either of
typewriter.jsortypewriter.min.jsto your project.
- Clone the GitHub repository
https://github.com/EOussama/typewriterjs.git. - Run
npm installto install all the dependencies. - Run
npm run prodto build the package. - The production script will be placed in the
distfolder.
The following example types the string “Hello, world!”:
index.js
<div id="target"></div>script.js
var typewriter = new Typewriter("#target");
typewriter.type("Hello, world!");See more use cases here.
Icon made by Freepik from www.flaticon.com