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

autotyping

v1.2.6

Published

This is a JavaScript library that allows you to easily and quickly implement a type writer effect on your website or application.

Downloads

55

Readme

AutoTyping.js

New release, new features:

22 February 2021

  • new option - textDeleteOptions
  • new method - stop()

npm version

https://unsplash.com/photos/6rkJD0Uxois

This is a JavaScript library that allows you to easily and quickly implement a type writer effect on your website or application.

There are many options available for you that you may or may not include, the JavaScript AutoTyping library will definitely work for you.

Lightweight. Only 4.06kb - minified version.

AutoTyping DEMO


Installation

Just clone or download the zip of this GitHub repository

or via npm:

npm install --save autotyping

Setup

<!-- just AutoTyping.js or .min.js -->
<script src='path/to/AutoTyping.min.js'></script>

and in your custom.js or direct between

<script></script> tag in HTML add:

const myText = new AutoTyping({
  id: 'example',                   //Your HTML element id (string) - REQUIRED
  typeText: ['words','sentences'] //Your text (array with strings)
}).init();

Options

  • id: Your HTML element id (string) - REQUIRED
  • typeText: Your text (array with strings)
  • textColor: Color of Your text (string) *default('#000')
  • typeSpeed: Interval between each character (nummber) *default(100ms)
  • typeRandom: Random interval between each character (boolean) *default(false)
  • typeDelay: Delay interval between typing two texts (number) *default(100ms)
  • cursor: Character for cursor (string) *default('|')
  • cursorColor: Color of the cursor (string) *default('#000')
  • cursorSpeed: Interval of the cursor blinks (number) *default(300ms)
  • deleteSpeed: Interval of deleting text (number) *default(50ms)
  • deleteDelay: Delay interval before deleting text (number) *default(2000ms)
  • typeInfinity: Autotyping infinity or only one cycle (boolean) *default(true)
  • callBack: Callback function - triggered after every typing cycle (object) *default(null)
    • counter: Every typing cycle counter is reduced by 1, after 0 it is reset (number)
    • method: function(counter){...} Your function (function)
  • textDeleteOptions: deleting a text to a specific character, and typing a new sequel (object) *default(null)
    • (index of strings in "typeText" Array - Example 0 : {...}): (object)
      • deleteToChar: index of the characters of the selected string, where the writing new part of text beginning (number)
      • continueThis: a new piece of text to be written (string)

If you set a value for a color property to an empty string, the element will inherit the style from the parent element.


Methods

  • init() - start AutoTyping
  • stop() - stop AutoTyping after last triggered cycle

Example

const myText = new AutoTyping({
  id: 'example',                   //Your HTML element id (string) - REQUIRED
  typeText: ['words','sentences'], //Your text (array with strings) - REQUIRED
  textColor: '#dc3545',            //Color of Your text (string) *default('#000')
  typeSpeed: 50,                   //Interval between each character (nummber) *default(100ms)
  typeRandom: true,                //Random interval between each character (boolean) *default(false)
  typeDelay: 200,                  //Delay interval between typing two texts (number) *default(100ms)
  cursor: '/',                     //Character for cursor (string) *default('|')
  cursorColor: '#dc3545',          //Color of the cursor (string) *default('#000')
  cursorSpeed: 200,                //Interval of the cursor blinks (number) *default(300ms)
  deleteSpeed: 50,                 //Interval of deleting text (number) *default(50ms)
  deleteDelay: 2000,               //Delay interval before deleting text (number) *default(2000ms)
  typeInfinity: true               //Autotyping infinity or only one cycle (boolean) *default(true)
  callBack: {                      //Callback function - triggered after every typing cycle (object) *default(null)
    counter: 4                     //Every typing cycle counter is reduced by 1, after 0 it is reset (number)
    method: function(counter){...} //Your function (function)
  },
  textDeleteOptions: {             //deleting a text to a specific character, and typing a new sequel (object) *default(null)
    0: {                           //index of strings in "typeText" Array (key-number : value-object)
      deleteToChar: 2,             //index of the characters of the selected string, where the writing new part of text beginning (number)
      continueThis: "rld best"     //a new piece of text to be written (string)
    }
  }
}).init();