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

@eccenca/utils

v1.6.0

Published

A set of small utility function that may not fit in any other package

Readme

@eccenca/utils collection

A set of small utility function that may not fit in any other package.

uuid

Creates a v4 uuid. Is basically a wrapper around the npm package uuid. For options see here

import {uuid} from '@eccenca/utils';

const id = uuid();

URI

Wrapper around URI.js.


import {URI} from '@eccenca/utils'

const newURI = new URI('http://example.org');

//Our wrapper adds this check:
//Returns true if URI is urn-like or an absolute URL
newURI.is('resourceURI');

changeFavicon

Change a favicon of a website dynamically.

import {changeFavicon} from '@eccenca/utils';

changeFavicon(
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgAQMAAABJtOi3AAAABlBMVEUAAAD+jwHRIVMHAAAAAXRSTlMAQObYZgAAAHlJREFU" +
"CNctzbEJAzEQRNF/KBAGw6aOtG04EHJbFwisElzSlqISFCo4Tl7sg+EFE8yADC6C/biDzgTvs8A6K9s6JmHcBtFCR1o0BPmgD32SctkppVayzkyW4cTuBH" +
"O25uBJsP9RmEhjILb5aI+dMNX8aDVYC3gdjvdfRm8rdNXB000AAAAASUVORK5CYII="
);

getBrowserLocales

Retrieve preferred locales by the user. Values are read from the window.navigator object

import {getBrowserLocales} from '@eccenca/utils';

//Returns for example ['de-AT', 'de', 'en']
getBrowserLocales();

getBestLocale

Returns best match between a list of preferred locales and supported locales. Preferred locales default to getBrowserLocales and order is important (First in array is most important locale). If no match can be found a default locale will be returned.

import {getBestLocale} from '@eccenca/utils';

//returns 'en' (default value)
getBestLocale();

//returns 'de' (default value)
getBestLocale({defaultLocale: 'de'});

//suppose a user has a preference of ['de-AT', 'en'] in their browser
//returns 'de'
getBestLocale({supportedLocales: ['de', 'en']});

//returns 'en-AU'
getBestLocale({
    preferredLocales: ['de-AT', 'en'],
    supportedLocales: ['en-AU', 'ru-RU'],
});

//Sometimes order matters in supportedLocales
//suppose a user has a preference of ['en-US', 'de'] in their browser
//returns 'en'
getBestLocale({supportedLocales: ['en', 'en-AU', 'de']});
//returns 'en-AU'
getBestLocale({supportedLocales: ['en-AU', 'en', 'de']});

sanitizeFileName

Transform all not common letters like 'ö,ä,ü,é' to standard latin and replace all special characters like '$,],¶' to a single '_' from a given string. Has optional parameter ensureType in options

import {sanitizeFileName} from '@eccenca/utils';

string = '<oxo|{[¢$frmble?.csv';
//Returns 'oxo_frmble.csv'
sanitizeFileName(string, {ensureType: 'csv'});

convertSpringPropertyObject

Helps to convert Spring Property Objects to proper Javascript Objects

    const input = {
        'foo.bar.string': '123',
        'foo.bar.array': ["a", "b", "c"],
        '[http://example.org]foo.bar': {
            'a.b': 12
        }
    };

    const output =
        {
            "foo": {
                "bar": {
                    "array": [
                        "a",
                        "b",
                        "c",
                    ],
                    "string": "123"
                }
            },
            "http://example.org": {
                "foo": {
                    "bar": {
                        "a": {
                            "b": 12
                        }
                    }
                }
            }
        }
    ;

    should(convertSpringPropertyObject(input)).deepEqual(output);