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

hyper-custom-plugins

v1.1.2

Published

Create Hyper.app plugins from Hyper.app's configuration file `~/.hyper.js`.

Downloads

4

Readme

hyper-custom-plugins

Create Hyper.app plugins from Hyper.app's configuration file ~/.hyper.js.

Why?

Sometimes all you want is a small change to the configuration or plugins in Hyper.app, but you don't want to have to create a whole plugin for it! This plugin makes it much easier to write mini-plugins that can do anything a normal plugin can do.

How to Use It

Just add the following properties to your ~/.hyper.js.

config.customPlugins

The object containing the properties below:

config.customPlugins.output

A boolean value; whether to print to STDOUT the npm commands' output.

config.customPlugins.dependencies

An optional array of npm module dependencies that will be used in your plugins. These npm modules will be dynamically installed and passed to config.customPlugins.callback afterwards.

config.customPlugins.callback

A function to be stringified and run in a Node.js vm. It will have access to the global variable from hyper-custom-plugins and the object, containing the following properties, as an argument:

  • hooks: An object that references hyper-custom-plugins' module.exports. Mutate this object to add other Hyper.app hooks. Overriding the decorateConfig property will prevent the config.customPlugins.callback function from running until a new session is created or "Update Plugins" is run.

  • config: The initial config object after it has been decorated by other plugins, unless hyper-custom-plugins is the first in the plugins array inside ~/.hyper.js. Mutate this object to change config.

  • dependencies: An object with keys that will be the name of the npm modules passed in config.customPlugins.dependencies and values that will be the npm modules after being required.

  • module: A reference to hyper-custom-plugins' module object.

Example

I like to use the theme hyperterm-material, but I wish that the config.backgroundColor it sets was slightly transparent! Instead of creating a whole module just for this purpose, I just use hyper-custom-plugins like this:

module.exports = {
  config: {
    customPlugins: {
      output: false,
      dependencies: ['color'],
      callback: ({ hooks, config, dependencies, module }) => {
        const { color: Color } = dependencies;
        const { backgroundColor } = config;
        const newBackground = Color(backgroundColor).fade(0.3).rgb().string();
        config.backgroundColor = newBackground;
      },
    },
  },
  plugins: [
    'hyperterm-material',
    'hyper-custom-plugins'
  ],
};