Skip to main content

Developing Plugins

Ima mnogo načina da proširite verdaccio, tipovi podržanih plugin-a su:

Preporučujemo developing plugins koji koriste naše flow type definicije.

Other plugins

U suštini treba da vratimo objekat korišćenjem metode zvane authenticate koja prima 3 argumenta (user, password, callback).

Theme Plugin

The plugin must return a function that returns a string. The string should be the absolute location of the root of your user interface.

API

const path = require('path');

module.exports = (...arguments) => {
return path.join(__dirname, 'static');
};

It is imporant that the name of the plugin must start with verdaccio-theme- prefix.

Theme Example

Filter Plugin

Since 4.1.0

Ili se nešto loše dogodilo ili auth nije bila uspešna.

More info in the PR.

callback(null, false)

API

groups čini niz stringova u koji spada korisnik.

Do not remove properties from the metadata, try to do not mutate rather return a new object.

interface IPluginStorageFilter<T> extends IPlugin<T> {
filter_metadata(packageInfo: Package): Promise<Package>;
}