# plerry

> A Tiny Pluggable system for Node.js

Latest version **0.1.2** (published 2023-02-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install plerry
pnpm add plerry
yarn add plerry
bun add plerry
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2023-02-02 |
| First published | 2023-01-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Riccardo Tartaglia |
| Maintainers | riktar |

## Links

- npm: https://www.npmjs.com/package/plerry
- npm.io page: https://npm.io/package/plerry

## Recent versions

- 0.1.2 (latest) — 2023-02-02
- 0.1.1 — 2023-01-05
- 0.1.0 — 2023-01-04
- 0.0.6 — 2023-01-04
- 0.0.5 — 2023-01-04
- 0.0.4 — 2023-01-04
- 0.0.3 — 2023-01-04
- 0.0.2 — 2023-01-04
- 0.0.1 — 2023-01-04

## README

# Plerry⚡Supercharge your Node Applications
> Plerry is a pluggable system that makes it easy for developers to extend the functionality of their NodeJS applications.

[![npm version](https://badge.fury.io/js/plerry.svg)](https://badge.fury.io/js/plerry)


With Plerry, you can quickly and easily add new features to your app, without having to spend hours coding and debugging

```js
const Plerry = require('plerry');
const plerry = new Plerry();

const main = async () => {
  plerry.register((app) => {
    console.log('Plugin Loaded!');
    app.decorate('test', () => {
      console.log('test')
    })
  }, {name: 'test'})

  // Load all plugins
  await plerry.ready()
  // in the console you will see "Plugin Loaded!"

  // Call the test function decorated by the plugin
  plerry.test()
}

main()

```

## Installation

To install Plerry, run the following command:

```bash
npm install plerry
```

## How to Use

Using Plerry is simple. First, require the module in your code:

```js
const Plerry = require('plerry');
```

Next, create a new Plerry instance and register your plugins:

```js
const plerry = new Plerry();
plerry.register(myPlugin);
```

## Writing Plugins
To write a plugin for Plerry, create a javascript module that exports a function. This function will be called with the Plerry instance as an argument, allowing you to register event handlers and access other plugins.

For example:

```js
module.exports = function(plerry) {
  console.log('Hello, world!');
  plerry.decorate('hello', function() {
    console.log('Hello, world!');
  });
}
```
## API

- `register(plugin, manifest)` - Registers a plugin with Plerry. The plugin argument is a function that will be called with the Plerry instance as an argument. The manifest argument is an object that can be used to specify the plugin's name and dependencies.

- `on(eventName, handler)` Registers an event handler for the specified event.

- `decorate(name, fn)` Adds a property to the Plerry instance.

- `ready()` - Loads all registered plugins and waits for them to complete loading.

---
_Source: https://npm.io/package/plerry · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
