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

type-commander

v1.1.0

Published

JavaScript animated typing

Downloads

11

Readme

Type-commander - a programmable typing animation tool

I've made this as an alternative of Typed.js. I also tried couple of other ones but they also didn't meet my needs. This library is quite small and it does the same typing animation. Except that it offers full control on where the cursor is, how many characters are added or deleted and what is the delay between the different operations.

preview

Demo https://poet.codes/e/QMX5eZWJ1S7

Pros

  • Full control on what and where is typed.
  • Speed control
  • Looping
  • 3.5KB
  • Dependency-free

Cons

  • No styling
  • No multi-line text

Installation

npm install type-commander

or directly use

https://unpkg.com/type-commander

Usage

<div id="content"></div>
const tc = TypeCommander('#content');

tc
  .delay(3000)
  .add('Hello world!').delay(2000)
  .moveTo(5).delay(500)
  .del('all').delay(300)
  .add('Bye bye').delay(2000)
  .del(4).delay(1000)
  .moveTo().delay(3000)
  .loop()
  .go();

The result is the gif above.

API

TypeCommander(<selector>, <initial text>, <cursor options>)

| | type | description | | ------------- |:-------------:| -----| | selector | <string> | Valid DOM selector. | | initial text | <string> | (optional) The initial text of the field. | | cursor options | <object> | (optional) An object that has width and height properties to be set to the cursor. | | returns | <object> | Type commander instance. |

.delay(<time>)

| | type | description | | ------------- |:-------------:| -----| | time | <number> | A time in milliseconds to delay before the next action. | | initial text | <string> | (optional) the initial text of the field | | returns | <object> | Type commander instance |

.add(<text>, <speed>)

| | type | description | | ------------- |:-------------:| -----| | text | <string> | The text to be added at the current position of the cursor. | | speed | <number> | Time in milliseconds. The speed of typing. | | returns | <object> | Type commander instance |

.del(<num of chars>, <speed>)

| | type | description | | ------------- |:-------------:| -----| | num of chars | <number> | The number of characters to be removed. | | speed | <number> | Time in milliseconds. The speed of deleting. | | returns | <object> | Type commander instance |

.moveTo(<position>)

| | type | description | | ------------- |:-------------:| -----| | position | <number> | A position in the text where the cursor will be moved to. | | returns | <object> | Type commander instance |

.loop()

It makes the animation looping.

| | type | description | | ------------- |:-------------:| -----| | returns | <object> | Type commander instance |

.go()

Runs the animation.

| | type | description | | ------------- |:-------------:| -----| | returns | <object> | Type commander instance |