You've spent countless nights and days developing your API.
All features are implemented.
Ensured everything is well written and tested.
All stakeholders are eargerly looking forward to the BIG release.
Press announcements have been published.
The deployment environment has been prepared and is longing to run some of that promissed code.
Your whole company, including the board of directors, including CEO, CTO, CFO, COO, CCC, CBA ... are gathering in the big presenstation room.
You open the deployment pipeline.
You press the giant red button, titled "LAUNCH".
The deployment is starting.
BUILD ✅
TEST ✅
PACKAGE ✅
DEPLOY ✅
You open up your app's logs for the whole company to see.
And then you present them with this ...
The most underwhelming 2 seconds of your career ...
With wow-mum-look-no-hands
you can give your app's start-up logs that little extra panache.
Impress your boss, impress your mum, impress your colleagues, impress everyone that don't have the slightest clue what your job is. Impress everyone you shouldn't need to impress. Get the promotion, get the bonus, retire to the south of France, live a life of luxury, start collecting art. Confess on your death bed that the BIG LAUNCH was just a show.
BUT WHAT A SHOW IT WAS !
This library is available via the public npm registry and should work with any Node version that has very basic ES6 support (e.g. Node 10+ should be fine).
# If using NPM
npm install wow-mum-look-no-hands
# If using Yarn
yarn add wow-mum-look-no-hands
It makes sense to run wow-mum-look-no-hands
as part of your app start up script.
The showtime()
method returns a Promise
that resolves as soon all messages, including their specified delay have been logged.
By default, the library is going to log via the console
functions (i.e. console.debug
, console.info
, console.warn
and console.error
, which correspond to the specified logLevel
properties)
// ES6 or TypeScript Import
import { Theatre, Message } from 'wow-mum-look-no-hands'
// CommonJS Import
const { Theatre, Message } = require('wow-mum-look-no-hands')
// Create a new Theatre instance
const theatre = new Theatre({
messages: [
{
logLevel: 'ERROR', // DEBUG | INFO | WARN | ERROR - DEFAULT: INFO
message: '⚙️ Defragment Windows 95 C:\ drive. This might take a while ...',
delayInMS: 500 // delay in milliseconds before above message is displayed - DEFALT: 250
},
new Message('🙈 Discovered year 2020. Aborting unnecessary Windows 95 operations.'),
new Message({
message: '⚙️ Processing super-vortex decission algorhithm ...',
delayInMS: 5000
})
// ...
// further messages for the Show
// ...
]
//,
//logger: (message: Message) => void // defaults to console - implement if other logging library is needed (see below for example)
})
// When ready, call showtime() to start the show
theatre.showtime() // Returns Promise, that resolves when the show is over
If you want to log via a different logging library and not via the console
functions, then you can provide a logger
property to the Theatre
configuration like this:
const theatre = new Theatre({
messages: [
// see above for examples
],
logger: message => {
const { logLevel, delayInMS, message } = message // message argument contains all message properties
// do what ever your logger requires
// Example: pseudo alternative logger call
myLog.log({
level: logLevel,
message: message
})
// return is void / not required
}
})
Contributions and error reports are always welcome. Please don't hesitate to raise an issue or a pull request against this GitHub issue
What are the chances that a great piece of software like this is published under a non-restrictive open source license?
The chances are good my friend. This project is published under the MIT License. See LICENSE for details
Very sorry to hear that. Unfortunately I'm not willing accept any responsiblity and don't provide any warranty for this project.
Yes
Yes