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

report-bug

v1.0.13

Published

```bash npm install --save report-bug ``` ## Import the report-bug Library.

Downloads

8

Readme

report-bug

Installation

npm install --save report-bug

Import the report-bug Library.

import BugReport from 'report-bug';

Usage

 <BugReport user = {current_username} app_id = {current_appname} color = {bug_icon_color} reportLink={destination_link}/>

Props

user : string (current logged in user) app_id : string (client app name) color : string (bug icon color) reportLink : Link (API Endpoint)

Working

  • Users can report a bug anywhere in our app by clicking on the Bug Icon. As soon as the user clicks the bug icon , captureScreenhot() method is called and a screenshot of the current screen is taken by using the html2canvas method. This method takes a DOM element as input and returns it's image i.e. body in our case. The image is then converted to base64 encoded URL using  image_name.toDataURL() method and stored in the this.state.
     captureScreenShot = async () => {
       const canvas = await html2canvas(document.querySelector("body"));
       const base64 = canvas.toDataURL("image/jpeg");
       this.setState({ screenshot: base64, modal: true });
     };
  • The page_id of the page on which the bug icon is clicked is fetched by using  window.location.pathname which returns the filename of the current page. The description given by the user in text area is also stored in this.state .
   this.state = {
     page_id : window.location.pathname.slice(1)
   }
  • when user clicks the submit submitHandler() is called which makes a post request to adminbugreport Api and Page id , user id, description, app_id and base64 encoded screenshot are sent to the backend and stored in customer_error_report table. If successful the Api returns a BugID which is displayed to the user on screen.
   const body = { page_id, user_id, desc,app_id, screenshot };
   const res = await Axios.post(Endpoints.adminbugreport, body);
   const bugId = res.data.body

Demo of Report Bug interface. Demo of bug submitted interface.

MIT © [email protected]