Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
npmtrends download flooding sanitisation

In the .js bundle on the npmtrends site I found the success handler for fetch requests.

It looks like this:

  e.fetch = function(t, e) {
      ...
      return this.retryer = new a.m4({
          fn: y.fetchFn,
          abort: null == h || null == (o = h.abort) ? void 0 : o.bind(h),
          onSuccess: function(t) {
              s.setData(t),

I put a breakpoint of the setData line and executed this in the terminal:

t.map((tt) => {
    tt.downloads = tt.downloads.map((d) => {
        d.downloads = d.downloads > 155911 ? 70000 : d.downloads;
        return d;
    })
    return tt;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment