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 🙏

© 2026 – Pkg Stats / Ryan Hefner

toaster-retry

v1.0.2

Published

Extension of toastr.js notifications. One notification type "retry", for error handling

Readme

toaster-retry

  • Easy to use, RETRY UI.
  • Extension of toastr.js notifications. One notification type "retry", for error handling

Requirements:

Install

Bower - (recommended)

bower install toaster-retry

npm

npm install toaster-retry

Download zip

Setup

  • Simple (required javascript libraries will be auto-load). Note: In order to stylesheet defs work well, make sure toastr-retry.css is loaded after body tag
        <html lang="en">
        <head>
            <meta charset="UTF-8">          
            <script src="http://code.jquery.com/jquery-latest.min.js"></script>
            <script src="js/toastr-retry.js"></script>
        </head>
        
        <body>
            <link href="css/toastr-retry.css" rel="stylesheet"></link>
  • Manual (load all javascript libraries)
        <html lang="en">
        <head>
            <meta charset="UTF-8">
            <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
                        <link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" rel="stylesheet">
                        <link href="https://cdnjs.cloudflare.com/ajax/libs/jquery-jsonview/1.2.3/jquery.jsonview.css" rel="stylesheet">
            
            <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>      
            <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
            <script src="js/toastr-retry.js"></script>                 
        </head>
        
        <body>
            <link href="css/toastr-retry.css" rel="stylesheet"></link>

Current version

ver 1.0.1

How to use it

The simpler way

toastr.retry(null,null,{
       onText : "There have been some errors",
       onTitle: "Simple Retry",
       onCancel: function () {
           // do some thing
       },
       onRetry: function () {
           // repeat
           simple_retry();
       },
       timeOut:10000,
});

Handling data being processed and response resulted from that process

toastr.retry(toPush,responseObj,
{
    // calculate non processed elements 
    onCalcRemainingNonPushed: function (toPush, responseObj) {
            var ret = [];
            toPush.forEach(function (current) {
                if (responseObj['ticket_ids_updated'].indexOf(current.ticketId) == -1)
                    ret.push(current);
            });
            return ret;
    },
    onText : function(toPush, responseObj, remaingNonUpdate){
        return 'Failed to update ' +
            (remaingNonUpdate.length) + '/' + toPush.length + ' tickets' ;
    },
    onTitle: function(ticketsToPush, responseObj, remaingNonUpdate){
        return "Retry update tickets (DEMO)",
    },
    onCancel: function (toPush, responseObj, remainingNonUpdades) {
        // do some think or not
        //unselectAllTickets(remainingNonUpdades);
    },
    onRetry: function (toPush, responseObj, remainingNonUpdated) {
        // any(execute, update, process, insert, [verb])
        execute_retry(remainingNonUpdated);
    },
    showInfo: true,
    // Information that will be available to see on retry notification
    onJSON: function (toPush, responseObj, remainingNonUpdated) {
        return {Updating: toPush,
            ResponseObj:responseObj,
            Remaining:remainingNonUpdated}
    },
    // timeOut=0 (forever), timeOut=miliseconds
    timeOut:0,
});

Aditional options

// if true display messages to console
consoleLog = false

// Text of retry button 
retryButtonText = "RETRY"

// Time wait until the notification is closed 
timeOut = 10000

// if true and mouse is hover the notification, then it closes
closeOnHover = true,

Time wait after mouse has been hover the notification
extendedTimeOut = 2000,

Author

Vitor Oliveira

License

toastr-retry is under MIT license - http://www.opensource.org/licenses/mit-license.php