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

@muzilator/sdk

v2.0.11

Published

Muzilator SDK

Downloads

2

Readme

Muzilator SDK

Use the Musilator SDK to build Muzilator plugins

Plugin Types

There are two types of plugins, Applications and Libraries

Applications

Libraries

API

Types

View

export type View = 'primary' | 'secondary'

Endpoiny

export interface Endpoint {
  libraryName: string
  channelName: string
}

Library Platform

export interface LibraryPlatform {
  createChannel(channelName: string): Promise<MessagePort>
  getUserId(): Promise<string>
  setSessionTerminationListener(onSessionTermination: () => Promise<void>): Promise<void>
}

Application Platform

export interface AppPlatform extends LibraryPlatform {
  loadLibrary(pluginId: string, libraryName: string, view?: View): Promise<void>
  connectChannels(source: Endpoint, target: Endpoint): Promise<void>
  disconnectChannels(source: Endpoint, target: Endpoint): Promise<void>
}

Functions

The platform SDK exposes two functions: initializeApplication and initializePlugnn. Use initializeApplication when you are developing an aplpication and initializeLibrary when you are developing a library

Platform functions

Initialize Application
export const initializeApplication = (): Promise<AppPlatform> =>

Call this function in your application as early as possible.

Initialize Library
export const initializeLibrary = (): Promise<LibraryPlatform> =>

Call this function in your library as early as possible.

Library and Application functions

Create Channel
createChannel(channelName: string): Promise<MessagePort>

Create a channel with a given name and returns a Port through which you can send and receive messages.

Get User ID
getUserId(): Promise<string>

Returns the user id of the user which is currently signed in with the platform

Set Session Termination Listener
setSessionTerminationListener(onSessionTermination: () => Promise<void>): Promise<void>

Registers a callback function which will be called before the session is terminated. The platform will terminate the session only after the callback function returns.

Application functions

Load Library

loadLibrary(pluginId: string, libraryName: string, view?: View): Promise<void>

Loads a library in the platform.

  • The pluginId is the ID of the plugin in the platform
  • The libraryName is used to refer to this library instance when connecting channels
  • The optinal view is used to open the library UI in either the primary or the secondary view

Connect Channel

connectChannels(source: Endpoint, target: Endpoint): Promise<void>

Connects a source channel to a target channel. When calling the connectChannel function from an application, you can use the helper Self function to denote a channel of the application itself.

Disconnect Channel

disconnectChannels(source: Endpoint, target: Endpoint): Promise<void>

Disconnects a previously connected channel