npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

typingwriter

v1.0.0

Published

A package that let's you write text on the screen! (With support for the way Korean is typed!)

Downloads

2

Readme

TypingWriter Version

A package that let's you write text on the screen! (With support for the way Korean is typed!)

Instalation

# npm
npm install typingwriter

# yarn
yarn add typingwriter

Usage

Importing

TypeScript

// Here we're importing the default export "TypingWriter", which is the TypingWriter class that returns promises
// as well as the "AsyncTypingWriter" class which is the TypingWriter class but it doesn't return promises and it queues all events.
import TypingWriter, { AsyncTypingWriter } from "typingwriter";

JavaScript

// Here we're importing the default export "TypingWriter", which is the TypingWriter class that returns promises
// as well as the "AsyncTypingWriter" class which is the TypingWriter class but it doesn't return promises and it queues all events.
const {
	AsyncTypingWriter,
	default: TypingWriter
} = require("language-flag-colors");

Or, if you only want the default TypingWriter

const TypingWriter = require("language-flag-colors");

Or if you only want the AsyncTypingWriter

const { AsyncTypingWriter } = require("language-flag-colors");

Using the classes

import TypingWriter, { AsyncTypingWriter } from "typingwriter";

// initialize the TypingWriter on the element with the id "target".
const typer = new TypingWriter("#target");

// write the text that was inside of the target element
await typer.write();

// write the given text
await typer.write("TypingWriter");

// delete all the text in the target element
await typer.delete();

// delete 8 characters from the target element
await typer.delete(8);

// delete 8 characters from the target element but skip the first 5
await typer.delete(8, 5);

// pause any active deleter or writer
typer.pause();

// continue any paused deleter or writer
typer.continue();

// wait 5seconds
await typer.wait(5000);

// fully exit the class and remove any wrappers
typer.exit();

const asynctyper = new AsyncTypingWriter("#target");

// same as the TypingWriter but you can queue everything;
asynctyper.write().delete(8).wait(5000).delete(8, 5).exit();

Available options

The options object can be passed the to classes as the second argument.

| Option | Description | Available values | | ---------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | | cursor | the character the cursor should be | string \| false (false to disable cursor), default: "\|" | | typingInterval | the interval in which text should be typed | "humanized" \| number \| [number, number], default: "humanized", the array of numbers is to get a random interval between given numbers. | | deleteInterval | the interval in which text should be deleted | "humanized" \| number \| [number, number], default: "humanized", the array of numbers is to get a random interval between given numbers. | | autoStart | automatically start typing on class creation | boolean, default: false | | append | append text given in write to existing text of the element | boolean, default: false | | cursorStyles | whether or not the cursor styling should be added to the DOM | boolean, default: true | | cursorClassName | the class name the cursor should get | string, default: "typingwriter__cursor" | | wrapperClassName | the class name the wrapper should get | string, default: "typingwriter__wrapper" | | loop | (only for AsyncTypingWriter) loop the given queue | boolean, default: false |

Contributing

Due to the complex nature of this package, it is possible that some features may not be perfect. If you believe so and found a solution, feel free to open a pull request.

Inspiration

There are a lot of typers that do this, but almost none of them have support for Korean which I needed for my localized website. Nor were there a lot of typers that support typing multiple elements at once. Hence why I decided to make one that has it all!