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

smart-issue-tracker-sdk

v1.2.1

Published

A simple, flexible, light sdk to track any kind of errors and create automatic issue if found new.

Downloads

33

Readme

A simple, flexible, light sdk to track any kind of occurrences and create automatic issue if found new.

Demo

Take a look to the demo 👉👉 HERE 👈👈

There are many ways to use this sdk:

  • Use it as a webhook for your data collection in order to create issue for new alerts. For example, from ElasticSearch alert action.
  • Use it to search similar issues from a text input
  • etc.

Install

yarn add -D smart-issue-tracker-sdk

Usage

import { trackIssues } from 'smart-issue-tracker-sdk'
// --- your issue client
class MyIssueClient {
  constructor() {
    this.store = []
  }
  async createIssue(issue) {
    // here you can create the issue related to an untracked error
    const savedIssue = {
      ...issue,
      id: this.store.length.toString(),
      url: 'http://issue-client/newIdIssue',
      body: `Found ${issue.newOccurrences.length} occurences of "${issue.title}"`,
    }
    this.store.push(savedIssue)
    return this.store[this.store.length - 1]
  }
  async updateIssue(error) {
    // here you can update the issue for example add a new comment for new occurences
    const comments = [
      ...error.comments,
      `Found new ${error.newOccurrences.length} occurences of ${error.title}`,
    ]
    return { ...error, comments }
  }
  async fetchIssues() {
    return this.store
  }
}
// Your custom comparator
const compareOccurrence = (a, b) => a.message.localeCompare(b.message)
// use it
const errors = [
  { message: 'Error when create the checkout', timestamp: 1 },
  { message: 'Error When Create The Checkout', timestamp: 2 },
  { message: 'Null Pointer Exception on payment page', timestamp: 3 },
  { message: 'cannot call login on undefined', timestamp: 4 },
  { message: 'Null Pointer Exception on payment page', timestamp: 5 },
]
trackIssues(errors, {
  issueClient: new MyIssueClient(),
  hooks: {
    getIdentifier: (occurrence) => occurrence.timestamp, // to avoid adding same occurrence
    compareOccurrence,
  },
}).then((trackedErrors) => console.log(trackedErrors))
// should return
// - "Error when create the checkout" (occurrences : 2)
// - "Null Pointer Exception on payment page" (occurrences : 2)
// - "cannot call login on undefined" (occurences : 1)

Usage in Typescript

Take a look to the typescript version

Author

👤 Ludovic Dorival

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2021 Ludovic Dorival. This project is BSD--3--Clause licensed.

Contributing

We welcome community contributions and pull requests. See CONTRIBUTING.md for information on how to set up a development environment and submit code.

This README was generated with ❤️ by readme-md-generator