Fake-chat
![GitHub issues](https://img.shields.io/github/issues/rah-emil/fake-chat)
Introduction
Overview
JavaScript / TypeScript plugin for posting messages in your html code. It's project just for fun, for me
Features
- posting messages with a selected delay
Installation
NPM
To install fake-chat using npm, run the following command in your project's terminal:
npm install @rah-emil/fake-chat
CDN (jsDelivr)
You can also include fake-chat directly in your HTML file using a CDN like jsDelivr:
Add the following script tag to your HTML file:
<script src="https://cdn.jsdelivr.net/npm/@rah-emil/fake-chat@3.0.1/dist/fake-chat.umd.js"></script>
Replace 3.0.1 with the version you want to use. You can find the latest version on the npm package page.
Basic Usage
The plugin has typescript support!
import FakeChat from 'fake-chat';
const chat = document.querySelector('#fake_chat');
const chatOptions = {
position: 'beforeend',
messages: [
{ text: 'Hello!', delay: 1000 },
{ text: 'How are you?', delay: 1500 },
],
};
const fakeChat = new FakeChat(chat, chatOptions);
fakeChat.init();