Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

run in Browser - without node #7

@tefod-zz

Description

@tefod-zz

Hi,
due I needed a browser solution for sending push notifications, just ran it through browserify.
I made a window function, which can be called through the HTML.
Following main.js is been browserfied. Works great.

window.ProwlPush = function (
  apikey,
  content,
  header,
  priority = 0,
  description = null,
  url = null
) {
  var Prowl = require("node-prowl");
  var prowl = new Prowl(apikey);

  prowl.push(
    content,
    header,
    {
      priority: priority,
      description: description,
      url: url,
    },
    function (err, remaining) {
      if (err) throw err;
      console.log(
        "I have " + remaining + " calls to the api during current hour."
      );
    }
  );
};

But even after minifying with uglifyjs there is still a 1.3Mb file.

So, is there an easier or native JS way to send push notification per Prowl - or can we dispense for some require's, so that we can slim down a bit?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions