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 🙏

© 2024 – Pkg Stats / Ryan Hefner

exc-core-v2

v1.0.6

Published

ExcCoreModule implements some static core features for the app and the communication between components, directives, services etc.

Downloads

2

Readme

Module Exc-Core-V2

ExcCoreModule implements some static core features for the app and the communication between components, directives, services etc.

##Install To install ExcRestModule into your project use

npm i exc-core-v2

Usage

ExcCoreModule can be used everywhere in your application. There is no need to import it as dependeny in your app.module. In every Module, Component, Directive or service you can import it an can use it as a static class.

Example

import {ExcCoreModule} from 'exc-core-v2';

Members

Array

Methods

|Method|Return|Description| | --- | --- | --- | | Get(array,value)|any|Gets the first entry from array matches to value| | GetIndex(array,value)|number|Gets the index of the first entry from array matches to value| | GetObject(array, key, value)|any|Gets the first entry from array of objects where the object[key] matches to value| | GetObjectIndex(array, key, value)|number|Gets the index of the first entry from array of objects where the object[key] matches to value| | GetAll(array, key, value)|any[]|Gets all entries from array of objects where the object[key] matches to value| | Remove(array, value)|any[]|Removes the first element from the array matches to the value. Returns remaining array items| | RemoveObject(array, key, value)|any[]|Removes the first element from the array matches to the value. Returns remaining array items| | RemoveAll(array, value)|any[]|Removes all elements from the array matches to the value. Returns remaining array items| | RemoveObjectAll(array, key, value)|any[]|Removes all elements from the array matches to the value. Returns remaining array items| | Add(array, value)|any[]|Adds an element to the array. Returns result array| | Merge(array1, array2)|any[]|Adds all elementes of array2 to array1. Returns merged array| | Exists(array, value)|boolean|Search an array for an element matches to the value. Returns true or false| | ExistsObject(array, key, value)|boolean|Search an array for an element where the object[key] matches to the value. Returns true or false| | Distinct(array)|any[]|Removes duplicated items in array.| | ExistsObject(array, key)|any[]|Removes duplicated items in array where the object[key] matches.|

Guid

Methods

|Method|Return|Description| | --- | --- | --- | |NewGuid()|string|Generates a new uniqueidentifier (Guid)|

Object

Methods

|Method|Return|Description| | --- | --- | --- | |Replace(destination,source)|void|Replaces all values in destination object from source object.Keeps values in destination if they doesn't exist in sourceIgnores values from source if they doesn't exist in destination| |Merge(destination,...source)|void|Merges values from all source objects to destination object| |DeepMerge(destination,...source)|void|Merges (recursive) values from all source objects to destination object|

String

Methods

|Method|Return|Description| | --- | --- | --- | |Format(text,...args)|string|Formats a string and injects the arguments by indexExampleExcCoreModule.String.Format("This {0} is crazy for {1}!","world","Robin") returns "This world is crazy for Robin!"| |Reverse(text)|string|Reverses a given string|

Methods

|Method|Return|Description| | --- | --- | --- | |on(name,callback)|function|Registers a callback function to a specified name as an event| |call(name,...args)|function|Calls all callback functions for the specified name and tunnels all arguments to callback functions.| |showInfo(message,title?)|void|Calls "eAM.ShowInfo" event. Listening to this event with ExcCoreModule.on("eAM.ShowInfo",function(message,title){//Your code here});| |showSuccess(message,title?)|void|Calls "eAM.ShowSuccess" event. Listening to this event with ExcCoreModule.on("eAM.ShowSuccess",function(message,title){//Your code here});| |showWarning(message,title?)|void|Calls "eAM.ShowWarning" event. Listening to this event with ExcCoreModule.on("eAM.ShowWarning",function(message,title){//Your code here});| |showError(message,title?)|void|Calls "eAM.ShowError" event. Listening to this event with ExcCoreModule.on("eAM.ShowError []() ",function(message,title){//Your code here});| |showModal(content,header?,size?,data?,closeViaOverlay?,footerButtons?)|Observable|Open a modal window as configured. Place content as string or place a component name| |RegisterService(key,value)|void|Registers a value to ExcCoreModule.Services().| |RegisterConfig(key,value)|void|Registers a value to ExcCoreModule.Config().| |Services()|any|Gets all values registered by RegisterService(key,value)| |Config()|any|Gets all values registered by RegisterConfig(key,value)|

Class ExcTranslation

ExcTranslation is a class for translation of text resources. All other classes using translation have to extend this class

Example

export class ClassName extends ExcTranslation {}

After this you have the option to use translations in ClassName

####Dependencies If you want to use ExcTranslation class you have to register a TranslateService into ExcCoreModule.

You can add exc-rest-v2 as package and use ExcTranslateService for that.

Details for adding and implementation are in readme of exc-rest-v2 package description.

Methods

|Method|Return|Description| | --- | --- | --- | |getCurrentLang()|string|Get current selected language as string| |onLangChange|Observable|Define a callback function which is called at language change| |getResource(name,param?)|string|Get a text resource of the current ClassName and the selected language. You can use placeholders in translation file to pass params to specific positions| |getRessource(name,param?)|string|(deprecated) Get a text resource of the current ClassName and the selected language. You can use placeholders in translation file to pass params to specific positions| |getGlobal(name,param?)|string|Get a global text resource and the selected language. You can use placeholders in translation file to pass params to specific positions| |getTranslation(name,param?)|string|Get text resource from root position and the selected language. You can use placeholders in translation file to pass params to specific positions|