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

minsky-lib-manager

v1.0.0

Published

Manage your js vendor dependencies clientside.

Readme

Lib Manager

Manage your js vendor dependencies clientside.

Manager that helps us manage js dependencies on the client side. This way we can load libraries when we need, where we need instead of including them in full on page load. Even if they aren’t required for the page to work.

Note: This manager works as a singleton! Every “new” instance created is in fact the same.

Class type: Manager

Dependencies

  • EventDispatcher 1.0.0

Getting started

LibManager acts as a thin wrapper around logic that it’ll execute the moment the requested libraries are loaded.

// create lib manager instance with library definitions
const mgr = new LibManager({
    libraries: {

        // self hosted
        selfHostedLib: {
            url: '/libs/self-hosted.js'
        },

        // Using cdn's
        swiper: {
            url: 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.5.0/js/swiper.min.js',
            css: 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.5.0/css/swiper.min.css'
        },

        // externals sdk's like google maps
        googleMaps: {
          url:              '//maps.googleapis.com/maps/api/js',
          parameters: {
              key:          '[KEY]',
              libraries:    'places'
          }
        }
    }
});



// init instance with a dependency managed by the maanger
mgr.load('swiper')
    .then( (e) => {
        const swiper = new Swiper(...);

        ...
    })
    .catch( (e) => {
        throw('Error', e)
    })

Constructor Parameters

args

Type: Object Default: {}

Config options that will be used when instance is created

objectName

Type: String Default: 'Component'

Object name that will be used as recognisable identifier and as prefix in logs


Interface

Options

libraries

Type: Object Default: {}

Dictionary of library definitions. Key name will be used to look up and load the requested library when necessary.

Use following parameters to

  • url: the url of the javascript library
  • css: the url to the css file
  • parameters: Url parameters to add to the url of the library (can be ignored if they are already concatenated in the url parameter)

… Event dispatcher options

Properties

version

Type: String Default: [ version number ]

Returns the version number of the class definition

… Event dispatcher properties

Methods

add

Parameters: Object Return: undefined

Add a collection of library definitions

load

Parameters: String or Array Return: Promise

Loads one or multiple libraries depending on the keys given. Promise is run once the given libraries are loaded or have failed.

… Event dispatcher methods


To Do

  • Fallback definition in case externally hosted library returns 404
  • Change ‘url’ key in library definition to ‘js’