# stupid-singleton

> A singleton creater for JS (browserify)

Latest version **1.0.0** (published 2015-11-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install stupid-singleton
pnpm add stupid-singleton
yarn add stupid-singleton
bun add stupid-singleton
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-11-22 |
| First published | 2015-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | David Adalberth Andersen |
| Maintainers | adalberth |

## Links

- npm: https://www.npmjs.com/package/stupid-singleton
- Repository: https://github.com/StupidStudio/stupid-singleton
- Homepage: https://github.com/StupidStudio/stupid-singleton#readme
- Issues: https://github.com/StupidStudio/stupid-singleton/issues
- npm.io page: https://npm.io/package/stupid-singleton

## Recent versions

- 1.0.0 (latest) — 2015-11-22

## README

# Stupid Singleton
Simple singleton creater for js (browserify).

## Usage

Creating a singleton:

```javascript
var Singleton = require('stupid-singleton');

function moduleConstructor(opts){
	var self = {};
	var opts = opts || {};
	self.name = "I am module";
	return self;
}
var Module = Singleton(moduleConstructor); 
var mod1 = Module.getInstance(); // returns an instance of moduleConstructor
var mod2 = Module.getInstance(); // return the same instance
console.log(mod1 === mod2); // true
```

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