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

typing-bc

v1.0.4

Published

Simple and powerful Javascript animated typing, with no dependencies(jQuery and so on).

Downloads

14

Readme

typing

Typing.js is a simple, powerful and without any dependencies(such as jQuery).

You can use it to implement a typing effect.

https://typing-blackcater.surge.sh

typing-example

Install

You can use typing.js in browser or node.js

Browser

typing.min.js is a UMD library.

The typing.min.js is in the directory dist/typing.min.js

Then add the following code :


<!-- default style, you can use or not -->
<link rel="stylesheet" href="path/to/typing.min.css">
<script src="path/to/typing.min.js"></script>

Node

You can install it with yarn or npm :


yarn add typing-bc --save
# or
npm install typing-cb --save-dev

Then, you should import the module :


// es5
const Typing = require('typing-bc').Typing

// es6
import { Typing } from 'typing-bc'

Use.

Typing supports multi-line.

So it is based on ul, li to constitute.

Typing.init

This is a function, it needs two parameters. First is string or HTMLElement. If it is a string, we will call querySelector to find the HTMLElement.

When you call this function. It will return an instance of Class Typing.

After you call this function, ul, li has been appended to HTMLElement said before.

Typing.run/typing.run

typing is an instance of Class Typing.

You can call this function to start typing.

const typing = Typing.init(...)

typing.run() // or Typing.run(typing)

Typing.stop/typing.stop

typing is an instance of Class Typing.

You can call this function to stop typing.

So, you can call run function to continute typing.


const typing = Typing.init(...)

typing.stop() // or Typing.stop(typing)

setTimeout(() => {
    typing.run() // continute typing
}, 2000)

Typing.abort/typing.abort

typing is an instance of Class Typing.

You can call this function to abort typing.

After you call this function, we can no longer recover to type.


const typing = Typing.init(...)

typing.abort() // or Typing.abort(typing)

typing.run() // It is no use.

Config

There are some properties which you can set.


const defualtConfiguration = {
    "cssPrefix": "typing", // css prefix
    "typeSpeed": 100, // typing interval
    "backSpeed": 50, // back interval
    "startDelay": 500,
    "sectionDelay": 1000,
    "sentenceDelay": 50,
    "blinkDelay": 20, // interval for blinking of typing cursor
    "infinite": false,
}

Examples

The following are some examples.

Simple use


import { Typing } from 'typing-bc'

// global config
Typing.config({
    infinite: true,
})

// init
Typing.init('#demo1', [
    'Typing is simple',
    'Typing is powerful',
    'Typing without dependencies',
]).run()

Advanced use


// global config
Typing.config({})

// run
Typing.init('#demo2', [
    [
        'Typing is simple',
        {
            text: 'It is really simple!!!!',
            styles: {
                color: 'red',
            },
        },
    ],
    [
        'Typing is powerful',
        {
            text: 'It is really powerful!!!!',
            styles: {
                color: 'green',
            },
        },
    ],
    [
        'Typing without dependencies',
        {
            text: 'Such as jQuery',
            styles: {
                color: 'yellow',
            },
        },
    ],
]).run()