![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@arturdoruch/flash-messenger
Advanced tools
Displays flash messages on the screen.
yarn add @arturdoruch/flash-messenger
import FlashMessenger from '@arturdoruch/flash-messenger';
const flashMessenger = new FlashMessenger({
// Options. See options description below.
});
// Adds messages with custom types to the stack.
flashMessenger.add('error', 'An error occurred.');
flashMessenger.add('notice', 'Notice message.');
flashMessenger.add('success', 'Success message.');
// Displays messages of all types.
flashMessenger.display();
// Displays messages of specific type.
flashMessenger.display('error');
Global options applied to the all FlashMessenger instances. Set by calling function setOptions().
import { setOptions as flashMessengerSetOptions } from '@arturdoruch/flash-messenger';
flashMessengerSetOptions({
// Options
});
elementsClassPrefix
string (default: flash-message
)
The class name prefix of the message container and item elements.
all the common options
Options specific for FlashMessenger instance.
import FlashMessenger from '@arturdoruch/flash-messenger';
const flashMessenger = new FlashMessenger({
// Options
});
containerClassName
string (default: null
)
Adds custom class name for message container div element.
all the common options
Global and per instance FlashMessenger options.
removeAfter
int|null (default: 5
)
Time (in seconds) after message item will be removed form the container. If null message item will not be removed until will be clicked.
removeOnClick
boolean (default: true
)
Specifies whether the message item should be removed after clicking.
positionVertical
string (default: top
)
Vertical position of displayed message container. One of: top
, center
, bottom
.
positionHorizontal
string (default: center
)
Horizontal position of displayed message container. One of: left
, center
, right
.
For styling flash messages use existing CSS styles import '@arturdoruch/flash-messenger/styles/flash-messenger.css';
or create your own.
FAQs
Displays flash messages on the screen.
The npm package @arturdoruch/flash-messenger receives a total of 0 weekly downloads. As such, @arturdoruch/flash-messenger popularity was classified as not popular.
We found that @arturdoruch/flash-messenger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.