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

@the-draupnir-project/interface-manager

v3.0.0

Published

This library provides a command-oriented presentation interface for Matrix bots. This is the library used by [Draupnir](https://github.com/the-draupnir-project/Draupnir) to provide command parsing, rendering and interaction prompts.

Downloads

633

Readme

@the-draupnir-project/interface-manager

This library provides a command-oriented presentation interface for Matrix bots. This is the library used by Draupnir to provide command parsing, rendering and interaction prompts.

This library also includes a JSXFactory that can transform JSX templates into org.matrix.custom.html and plain text fallback, so that it is possible to send Matrix events from one source.

const KickCommand = describeCommand({
  summary: "A command to test keyword arguments",
  parameters: tuple({
    name: "user",
    acceptor: MatrixUserIDPresentationType,
  }),
  keywords: {
    keywordDescriptions: {
      glob: {
        isFlag: true,
        description:
          "Allows globs to be used to kick several users from rooms.",
      },
    },
  },
  async executor(
    draupnir: Draupnir,
    _info,
    keywords
  ): Promise<Result<KickedUsers>> {
    return await draupnir.kickUsers(
      user,
      keywords.getKeywordValue("glob", false)
    );
  },
});

DraupnirInterfaceAdaptor.describeRenderer(
  KickCommand,
  {
    JSXRenderer(result) {
      if (isError(result)) {
        return Ok(undefined);
      }
      return Ok(
        <root>
          <details>
            <summary>Removed {result.ok.length} users from protected rooms.</summary>
            {renderKickedUsers(result.ok)}
          </details>
        </root>
      );
    }
  }
);

Getting started

At some point in the near future we will create a simple bot that will act as a template repository that can be copied and edited.

In the meantime Draupnir's glue/setup code for the library can be found here and this code is licensed under Apache-2.0.

Contributing & Opening Issues

Draupnir wants to be yours as much as it is ours. Please see or contributing document, but do not worry too much about following the guidance to the letter. And keep that in mind throughout.

Supported by

NLnet foundation

Draupnir is supported by the NLnet foundation and NGI Zero under the NGI Zero Core programme.

You can find details of the work that is being supported from NLnet here and the goals here.