# single-space

> Provides a simple way for ensuring the important parts of your module load only once.

Latest version **1.0.0** (published 2017-02-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install single-space
pnpm add single-space
yarn add single-space
bun add single-space
```

## 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 | 2017-02-21 |
| First published | 2017-02-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | CodeMedic42 |
| Maintainers | codemedic42 |
| Keywords | namespace, singleton |

## Links

- npm: https://www.npmjs.com/package/single-space
- Repository: https://github.com/CodeMedic42/single-space
- Homepage: https://github.com/CodeMedic42/single-space#readme
- Issues: https://github.com/CodeMedic42/single-space/issues
- npm.io page: https://npm.io/package/single-space

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4

## Recent versions

- 1.0.0 (latest) — 2017-02-21
- 0.0.1 — 2017-02-21

## README

# single-space
A module which provides a simple way for ensuring singleton in node.

[![npm version](https://badge.fury.io/js/single-space.svg)](https://www.npmjs.com/package/single-space)
[![Build Status](https://travis-ci.org/CodeMedic42/single-space.svg?branch=master)](https://travis-ci.org/CodeMedic42/single-space)
[![Coverage Status](https://coveralls.io/repos/github/CodeMedic42/single-space/badge.svg?branch=master)](https://coveralls.io/github/CodeMedic42/single-space?branch=master)


Code copied and modified gently from

https://derickbailey.com/2016/03/09/creating-a-true-singleton-in-node-js-with-es6-symbols/

Thanks to this developer.

Ussage
```js
const SingleSpace = require('single-space');

module.exports = SingleSpace('module.my.namespace.example', () => {
    function Example(options) {
        if (!(this instanceof Example)) {
            return new Example(options);
        }

        this.options = options;
    }

    Example.prototype.echo = function echo(sound) {
        return sound;
    }

    return Example;
});
```

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