New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

easy-alerts

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-alerts

Easy to use JavaScript alert package

  • 2.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

easy-alerts

Easy alerts is a package that provides easy-to-use alerts for your project. Easy alerts allow you to change images on your alert, as well as adjust the theme to match a light or dark setting.

Getting Started

To use easy-alerts, you will need to install the easy-alerts package from npm.

npm install easy-alerts

Once installed, import(or require) the package to your project.

import easyAlerts from 'easy-alerts';

or

const easyAlerts = require('easy-alerts');

You can also import individual alert functions from the package. Easy alerts currently has two alerts that you can use: successAlert and failureAlert.

Using easy-alerts functions

Once imported, you can invoke the easy-alerts function to create an alert. Easy alert functions take one argument, which is an object that contains items such as the message to display on the alert, the theme(light or dark), and more. Possible properties you can include on this object are:

  • message (required): a string containing the alert message.

  • theme (required): 'light' or 'dark' as a string.

  • imageURL: a string containing the imageURL you wish to use. If you don't include an imageURL, you will get the default image for your specified alert.

  • timeout: a number specifying how long(in milliseconds) you would like the alert to stay on the screen. If you do not include a timeout, the alert will stay on the screen until the user closes it.

An example of all of these put together with the successAlert would look like this:

    function createAlert = () => {
        const alertObj = {
            message: 'Your message here!',
            theme: 'dark',
            imageURL: 'Your imageURL here',
            timeout: 3000
        };

        successAlert(alertObj);
    }

Stay Tuned!

Easy alerts is constantly changing! Revisit our documentation regularly to see what changes we make.

FAQs

Package last updated on 19 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc