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

fahm-chat-ui

v0.0.2

Published

Stencil Component Starter

Downloads

1

Readme

Chat App Component

This is a reusable chat app component that provides a UI similar to popular messaging apps like WhatsApp or Telegram. It allows users to send messages and display a chat history.

Installation

To use the chat-app component in your Angular, React, or Vue project, follow the steps below.

Angular

  1. Install the chat-app package via npm:
npm install chat-app
  1. In your Angular module, import the chat-app module:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ChatAppComponent } from 'chat-app';

@NgModule({
  declarations: [ChatAppComponent],
  imports: [BrowserModule],
  bootstrap: [ChatAppComponent]
})
export class AppModule {}
  1. Use the chat-app component in your Angular template:
<chat-app endpoint="https://api.example.com/messages"></chat-app>

Replace "https://api.example.com/messages" with the actual endpoint URL to call when sending messages.

React

  1. Install the chat-app package via npm:
npm install chat-app
  1. Import and use the chat-app component in your React component:
import React from 'react';
import { ChatApp } from 'chat-app';

function App() {
  return (
    <div>
      <ChatApp endpoint="https://api.example.com/messages" />
    </div>
  );
}

export default App;

Replace "https://api.example.com/messages" with the actual endpoint URL to call when sending messages.

Vue

  1. Install the chat-app package via npm:
npm install chat-app
  1. Import and use the chat-app component in your Vue component:
<template>
  <div>
    <ChatApp endpoint="https://api.example.com/messages" />
  </div>
</template>

<script>
import { ChatApp } from 'chat-app';

export default {
  components: {
    ChatApp
  }
};
</script>

Replace "https://api.example.com/messages" with the actual endpoint URL to call when sending messages.

Props

The chat-app component accepts the following props:

  • endpoint (required): The API endpoint URL to call when sending messages. This should be a string.

Events

The chat-app component emits the following events:

  • messageSent: Triggered when a message is successfully sent. You can attach an event listener to handle this event.
const chatApp = document.querySelector('chat-app');

chatApp.addEventListener('messageSent', (event) => {
  console.log('Message sent:', event.detail);
});

Styling

The UI of the chat-app component can be customized using CSS classes and styles. Refer to the provided chat-app.css file for the available classes.

License

This project is licensed under the MIT License.


Feel free to customize the README to match your specific project structure or requirements.


To build and deploy a Stencil app, you can follow these general steps:

  1. Build the Stencil app:

    • Run the build command to generate the optimized static assets for your app:
      npm run build
    • The build command creates a www folder that contains the compiled assets (HTML, CSS, and JavaScript) of your Stencil app.
  2. Deploy the Stencil app:

    • Depending on your hosting environment and deployment workflow, you can choose one of the following options:

      • Static Hosting: If you have a static hosting provider, such as Netlify, Vercel, GitHub Pages, or AWS S3, you can deploy your Stencil app by uploading the contents of the www folder to the hosting provider.

      • Server Hosting: If you have a server hosting provider, such as Heroku, AWS EC2, or DigitalOcean, you can deploy your Stencil app by following the specific deployment instructions for your hosting provider. Typically, this involves setting up a server environment, installing dependencies, and configuring the server to serve the compiled assets from the www folder.

      • Serverless Architecture: If you are using a serverless architecture, such as AWS Lambda or Google Cloud Functions, you can deploy your Stencil app by packaging the compiled assets as a serverless function. This involves creating a serverless function that serves the compiled assets from the www folder and deploying it to your serverless provider.

  3. Set up routing (if needed):

    • If your Stencil app uses client-side routing (e.g., with Stencil Router), you may need to configure your hosting environment to support routing. This typically involves setting up URL rewriting rules to ensure that all requests are directed to the main index.html file of your app. Consult your hosting provider's documentation for instructions on configuring routing for your specific environment.
  4. Test and verify:

    • After deploying your Stencil app, test it thoroughly to ensure that all functionality works as expected in the deployed environment. Test various scenarios, including navigation, API calls, and any other features specific to your app.

Remember to consider security best practices, such as enabling HTTPS, protecting sensitive data, and implementing authentication and authorization mechanisms if required.

Note: The deployment process may vary depending on your specific hosting provider and deployment workflow. Refer to the documentation of your chosen hosting provider for more detailed instructions on deploying a Stencil app to their platform.