Skip to content

Latest commit

 

History

History
30 lines (17 loc) · 1.07 KB

1.introduction.md

File metadata and controls

30 lines (17 loc) · 1.07 KB

Introduction

Plug and Play is a tool targetting library and application authors to introduce a plugin architecture in their Node.js source code.

It simplifies complex code execution with well-defined interception points, we call them hooks, and it provides the library users the ability to extends, fix, and alter the execution flow of a code without changing it.

The library is released on the NPM registry under the MIT License.

Module system

The library supports both ESM and CommonJS. Whichever the module system, it exports a plugandplay function to create a new instance.

With ESM:

import { plugandplay } from 'plug-and-play'

With CommonJS:

const { plugandplay } = require('plug-and-play')

Note, internally, the code is written in ESM.

History

It was originally developped inside Shell, a CLI toolkit, and was later enhanced inside Nikita, an automation and deployment toolkit.