JSPM

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

A one-liner to at least explain why things didn't work out

Package Exports

  • fail-nicely

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-nicely) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

fail-nicely

A one-liner to at least explain why things didn't work out

Example

See demo: fail-nicely

npm install fail-nicely
var failNicely = require('fail-nicely');

failNicely('This demo requires WebGL 7 support!', {title: 'Sorry!'});

Usage

require('fail-nicely')(messageOrError[, options])

Appends an overlay to the body element with a short explanation of what happened. Usefulf for making quick and ugly demos a little less ugly. If the first argument is an Error, it will use the error's message. If it's a string, that will be the explanation. Options are:

  • bg: overlay background color (default: '#333')
  • fg: overlay foreground (text) color (default: '#fff')
  • zIndex: z-index of the overlay (default: 9999)
  • title: heading title (default: 'Sorry!')
  • fontFamily: font family (default: Helvetica, Arial, sans-serif)
  • position: positioning of the overlay element (default: fixed)
  • invert: quick shorthand for swapping the foreground/background colors

Returns: Nothing.

License

© 2016 Ricky Reusser. MIT License.