Gathering detailed insights and metrics for @camwiegert/typical
Gathering detailed insights and metrics for @camwiegert/typical
Gathering detailed insights and metrics for @camwiegert/typical
Gathering detailed insights and metrics for @camwiegert/typical
Animated typing in ~400 bytes 🐡 of JavaScript
npm install @camwiegert/typical
Typescript
Module System
Node Version
NPM Version
74.9
Supply Chain
99.5
Quality
74.9
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
550,962
Last Day
89
Last Week
1,703
Last Month
6,889
Last Year
94,703
MIT License
1,576 Stars
29 Commits
62 Forks
9 Watchers
1 Branches
2 Contributors
Updated on Jun 26, 2025
Minified
Minified + Gzipped
Latest Version
0.1.1
Package Id
@camwiegert/typical@0.1.1
Unpacked Size
8.35 kB
Size
3.24 kB
File Count
5
NPM Version
6.11.3
Node Version
12.11.0
Cumulative downloads
Total Downloads
Last Day
-38.2%
89
Compared to previous day
Last Week
-4.8%
1,703
Compared to previous week
Last Month
-14.7%
6,889
Compared to previous month
Last Year
-5.9%
94,703
Compared to previous year
Animated typing in ~400 bytes :blowfish: of JavaScript.
1npm install @camwiegert/typical
Instead of using a package manager, you can download typical.js
from GitHub and import it locally or import it directly from a CDN like unpkg.
1type(target: HTMLElement, ...steps: any[]) => Promise<void>;
The module exports a single function, type
, which takes a target element as its first argument, and any number of additional arguments as the steps to perform. Additional arguments perform actions based on their type:
string
arguments will be typednumber
arguments will pause, in millisecondsfunction
arguments will be called with the target element as an argumentPromise
arguments will wait for resolutionThe most basic usage of type
is providing a target element and a string to type.
1import { type } from '@camwiegert/typical'; 2 3type(element, 'text');
In order to pause typing at any point, pass a number of milliseconds to pause.
1type(element, 'Hello', 1000, 'Hello world!');
In order to loop, pass type
as a parameter to itself at the point at which you'd like to start looping. It can be helpful to alias type
as loop
to be explicit.
1import { 2 type, 3 type as loop 4}; 5 6const steps = [1000, 'Ready', 1000, 'Set', 1000, 'Go']; 7 8type(element, ...steps, loop);
To loop a finite amount, pass your steps multiple times.
1type(element, ...steps, ...steps, ...steps);
When passed a Promise
, type
will wait for it to resolve before continuing. Because type
itself returns a Promise
, that means you can wait on a set of steps to complete before starting another.
1const init = type(target, 'In a moment...', 500); 2 3type(target, init, 'start', 500, 'looping', loop);
Function arguments are passed the target element, and can be useful for operating on the target element between steps. If you return a Promise
, type
will wait for it to resolve.
1const toggle = (element) => 2 element.classList.toggle('is-typing'); 3 4type(target, toggle, 'Type me', toggle);
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
Found 1/26 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More