npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@12luckydev/ng-essentials-services

v2.0.0

Published

Collection of abstract classes to build 'smart' services for toasts, info and confirm dialogs. Makes it easier to use these features with internationalization. Assuming that your dialogs and toasts always have a title and a message :D.

Downloads

49

Readme

@12luckydev/ng-essentials-services

Collection of abstract classes to build 'smart' services for toasts, info and confirm dialogs. Makes it easier to use these features with internationalization. Assuming that your dialogs and toasts always have a title and a message :D.

What do i mean by 'smart'? Instead of providing e.g. for Toast the title and message body text, you can provide only the primary key for the translation.

So instead od this:

this._toastService.success("COMMON.SUCCESS.TITLE", "COMMON.SUCCESS.MESSAGE");

You can use that:

this._toastService.smartSuccess("COMMON.SUCCESS");

'Smart' method will add 'TITLE' and 'MESSAGE' (or any other values ​​depending on the configuration) to primary key and pass it to orginal success method.

Configuration

The passed parameters "title" and "message" in the 'toast', 'info' and 'confirm' subobjects are more important than those passed in the root of config object.

import { provideNgEssentialsServices } from "@12luckydev/ng-essentials-services";

providers: [
  provideNgEssentialsServices({
    title: "title",
    message: "message",
    toast: {
      success: "success",
      error: "error",
    },
  }),
];

OR

import { NG_ESSENTIALS_SERVICES, buildFullSettings } from "@12luckydev/ng-essentials-services";

providers: [
  {
    provide: NG_ESSENTIALS_SERVICES,
    useFactory: () =>
      buildFullSettings({
        title: "title",
        message: "message",
        toast: {
          success: "success",
          error: "error",
        },
      }),
  },
];

buildFullSettings function will build full settings model based on provided partial model.

Contexted service

Thanks to context services, calls with long keys do not take up half the screen :)

class Component{
    private _toastService = inject(ToastService);

    showToast(){
        this._toastService.success("VERY.LONG.I18N.KEY.COMMON.SUCCESS.TITLE", "VERY.LONG.I18N.KEY.COMMON.SUCCESS.MESSAGE");
    }

    private _contextedToastService = inject(ToastService).withContext("VERY.LONG.I18N.KEY.COMMON");

    showContextedToast(){
        this._contextedToastService.success("SUCCESS.TITLE", "SUCCESS.MESSAGE");
        // or even shorter
        this._contextedToastService.smartSuccess("SUCCESS");

    }
}

Toast service base

| Abstraction name | Description | | ----------------------- | ---------------------------------------------------------------------------------------------------------------- | | ToastBaseMethods | Interface with methods definitions for toasts service | | ToastBase | Base class with smart methods implementation | | ContextedToastService | A class that contains the context and passes it to the base class. Useful for services that support translations | | ToastBaseWithContext | Base class with smart methods implementation and context support |

Confirm Dialog service base

| Abstraction name | Description | | ------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | ConfirmDialogBaseMethods | Interface with methods definitions for confirm dialog service | | ConfirmDialogBase | Base class with smart methods implementation | | ContextedConfirmDialogService | A class that contains the context and passes it to the base class. Useful for services that support translations | | ConfirmDialogBaseWithContext | Base class with smart methods implementation and context support |

Info Dialog service base

| Abstraction name | Description | | ---------------------------- | ---------------------------------------------------------------------------------------------------------------- | | InfoDialogBaseMethods | Interface with methods definitions for info dialog service | | InfoDialogBase | Base class with smart methods implementation | | ContextedInfoDialogService | A class that contains the context and passes it to the base class. Useful for services that support translations | | InfoDialogBaseWithContext | Base class with smart methods implementation and context support |