simple-singleton

1.0.0 • Public • Published

simple-singleton

This module provides a function to make your classes singleton.

Installation

npm install simple-singleton

Example

To export class as singleton:

const singleton = require('simple-singleton');

class SomeClass {
  ...
}

module.exports = singleton(SomeClass);

To transform some class into a singleton class:

const singleton = require('simple-singleton');

const SingletonSomeClass = singleton(SomeClass);

Dependents (0)

Package Sidebar

Install

npm i simple-singleton

Weekly Downloads

4

Version

1.0.0

License

ISC

Unpacked Size

1.66 kB

Total Files

3

Last publish

Collaborators

  • rbosisio