1.0.2 • Published 4 years ago

ffel v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Node.js CI GitHub GitHub package.json version Snyk Vulnerabilities for GitHub Repo GitHub top language GitHub code size in bytes GitHub issues GitHub commit activity

FFEL

About

FFEL Firebase Email Logger.

FFEL is an alternate logging system for NodeJS applications. It uses SendGrid to send emails with an error message to a specified emial address. It was developed for programs running on Firebase Functions, but could be used anywhere an email needs to be send with an error.

Installation

FFEL can be installed via the Github Package Repository:

npm install @jaredforth/ffel@1.0.1

or NPM:

npm install ffel

Usage

To import the main Logger class, use:

const { Logger } = require('ffel');

The Logger class takes one argument, which must be an object of the form:

const msg = {
    to: 'email@example.com',
    from: 'email@example.com',
    subject: 'Example Subject',
    text: 'A message to send',
    apiKey: 'Your SendGrid API key'
}

Initialize with:

const logger = new Logger(msg);

Once setup has been completed, you can use the log() method to send an email via SendGrid and have your error logged to the console:

logger.log("Your error message")

This will send an email to the to field specified in the initialization argument and log the error to the console.