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

nodebb-plugin-cobi-boilerplate

v0.0.8

Published

Boilerplate code to easily set up a new plugin development enviromnent

Downloads

2

Readme

This directory has been slightly altered by Maximilian Nies to better suit the development processes at COBI-Soft. You just need to clone this repo and swap out all occurrences of "boilerplate" with the name of your plugin.

Setup

Clone this repo into a new directory and replace every occurrence of boilerplate with the name of your plugin.

Development

You can either develop the plugin directly in your NodeBB environement by moving the files of your plugin directory into its own folder inside of the node_modules folder of your NodeBB environment or you can develop it in a separate environement in which case you need to publish it and install it in your NodeBB environment. (Of course, any time you update the code, you need to publish and install it again).

Developing your plugin in a separate environment allows you to keep everything in order and later publish it to git (since any node_moduels files will of course be ignored in your NodeBB environment and not published to git). It also pretty much forces you to inclue the latest version of your plugin in your package.json.

Publishing a package to npm

In order for you to be able to install your plugin in your NodeBB environment, you need to publish it to npm publically.

To do this, simply run the command npm publish --access public in your plugin's environment. Note that you need to adapt your package.json code according to your respective plugin and version. Also make sure to adapt the name of your plugin here to the following format: nodebb-plugin-my-new-plugin

(You cannot publish a package with the same or previous version number)

Installing the plugin

Now that you published your plugin and its access modifier is set to public, you can simply npm install it. Since NodeBB does the heavy lifting for us, prefixing the plugin with nodebb-plugin is all we need to do to make NodeBB recognize this package as a plugin. You will need to restart NodeBB after installing (or updating) a plugin with ./nodebb restart.

Enabling the plugin

By default, your plugin will not be enabled. To enable the plugin, head to the admin panel at http://localhost:4567/admin. Head to http://localhost:4567/admin/extend/plugins#download and click the installed tab. Here, simply find your plugin and click "Activate". Now, rebuild and restart the process and you should be done.

Adding a menu item to the admin dashboard

If you want to add a settings page to the admin dashboard to allow you to configure settings, the necessary files are in ./static/templates/admin/plugins.

The menu entry is added in ./library.js using the plugin.addAdminNavigation method.

From the official NodeBB:

Quickstart Plugin for NodeBB

A starter kit for quickly creating NodeBB plugins. Comes with a pre-setup LESS file, server side JS script with an action:app.load hook, and a client-side script. Most plugins need at least one of the above, so this ought to save you some time. For a full list of hooks have a look at our wiki page, and for more information about creating plugins please visit our documentation portal.

Fork/Clone this or copy it, and using your favourite text editor find and replace all instances of nodebb-plugin-cobi-boilerplate with nodebb-plugin-cobi-your-plugins-name. Change the author's name in the LICENSE and package.json files.

Hello World

Really simple, just edit static/lib/main.js and paste in console.log('hello world');, and that's it!

Installation

npm install nodebb-plugin-cobi-boilerplate