JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 49
  • Score
    100M100P100Q82792F
  • License MIT

Easily print a fail whale

Package Exports

  • fail-whale

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fail-whale) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

fail-whale

▄████████████▄▐█▄▄▄▄█▌
█████▌▄▌▄▐▐▌██▌▀▀██▀▀
███▄█▌▄▌▄▐▐▌▀██▄▄█▌
▄▄▄▄█████████████

Easily print a fail whale

import { failWhale } from 'fail-whale';

// When something bad happens
failWhale("Something went wrong :(")

/* 
Prints to console.error:
▄████████████▄▐█▄▄▄▄█▌
█████▌▄▌▄▐▐▌██▌▀▀██▀▀
███▄█▌▄▌▄▐▐▌▀██▄▄█▌
▄▄▄▄█████████████

Something went wrong :(
*/

Inject your own logger (override default console.error)

const logWarn = {
    error: (msg: any) => console.warn(msg)
}

failWhale("Warn you instead", logWarn)

/* 
Prints to console.warn:
▄████████████▄▐█▄▄▄▄█▌
█████▌▄▌▄▐▐▌██▌▀▀██▀▀
███▄█▌▄▌▄▐▐▌▀██▄▄█▌
▄▄▄▄█████████████

Warn you instead
*/