# instsure

> Instsure is a function wrapper to ensure the object initialitation, preventing wrong callings to the constructor function without right context.

Latest version **0.2.1** (published 2016-05-12) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2016-05-12 |
| First published | 2016-05-10 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Rubén López Gómez |
| Maintainers | rubeniskov |

## Links

- npm: https://www.npmjs.com/package/instsure
- Repository: https://github.com/rubeniskov/instsure
- Homepage: https://github.com/rubeniskov/instsure#readme
- Issues: https://github.com/rubeniskov/instsure/issues
- npm.io page: https://npm.io/package/instsure

## Recent versions

- 0.2.1 (latest) — 2016-05-12
- 0.2.0 — 2016-05-10
- 0.1.2 — 2016-05-10
- 0.1.1 — 2016-05-10
- 0.1.0 — 2016-05-10

## README

# Instsure

[![Build Status][travis-badge]][travis-url]
[![Coverage Status][coverage-badge]][coverage-url]
[![Slack Status][slack-badge]][slack-url]
[![Version][version-badge]][npm-url]
[![Downloads][downloads-badge]][npm-url]
[![Node][node-badge]][npm-url]
[![License][license-badge]][license-url]

[Instsure][site-url] is a function wrapper to ensure the object initialitation, preventing wrong callings to the constructor function without right context.

[![NPM][npm-img]][npm-url]
[![GRID][coverage-img]][coverage-url]

Installation
============

Install with `npm install instsure --save`.

Usage
=====

To use, add the `require` node module or use browserify if you want to use in a browser:

```JavaScript

    // Wrapper Function

    const Instsure = require('instsure');

    var ConstructorWrapFoo = Instsure(function() {
        this.args = arguments;
        this.context = this;
    });

    ConstructorWrapFoo.prototype.foo = 'bar'

    var instance = new ConstWrapFoo(1,2,3,4),
        // or
        instance = ConstWrapFoo(1,2,3,4),
        // or
        instance = ConstWrapFoo.new([1,2,3,4]);

        console.log(instance.args) // [1,2,3,4];

        console.log(instance instanceof ConstWrapFoo); // true
```


```JavaScript

    // Existing Constructor

    const Instsure = require('instsure');

    var ConstructorFoo = function() {
        this.args = arguments;
        this.context = this;
    };

    ConstructorWrapFoo.prototype.foo = 'bar'

    var instance = new Instsure(ConstructorFoo)(1,2,3,4),
        // or
        instance = Instsure(ConstructorFoo)(1,2,3,4),
        // or
        instance = Instsure(ConstructorFoo).new([1,2,3,4]);

        console.log(instance.args) // [1,2,3,4];

        console.log(instance instanceof ConstructorFoo); // true

        console.log(instance instanceof ConstructorWrapFoo); // true
```

[![WTF][wtfpl-img]][wtfpl-url]

[site-url]: http://instsure.rubeniskov.com

[npm-url]: https://www.npmjs.com/package/instsure
[npm-img]: https://nodei.co/npm/instsure.png?downloads=true

[travis-url]: https://travis-ci.org/rubeniskov/instsure?branch=master
[travis-badge]: https://travis-ci.org/rubeniskov/instsure.svg?style=flat-square

[license-url]: LICENSE
[license-badge]: https://img.shields.io/badge/license-WTFPL-blue.svg?style=flat-square

[coverage-url]: https://codecov.io/github/rubeniskov/instsure
[coverage-img]: https://codecov.io/gh/rubeniskov/instsure/branch/master/graphs/icicle.svg?width=400&height=72
[coverage-badge]: https://img.shields.io/codecov/c/github/rubeniskov/instsure.svg?style=flat-square

[slack-url]: http://slack.rubeniskov.com/
[slack-badge]: http://slack.rubeniskov.com/badge.svg?style=flat-square&maxAge=2592000

[version-badge]: https://img.shields.io/npm/v/instsure.svg?style=flat-square&maxAge=2592000
[downloads-badge]: https://img.shields.io/npm/dm/instsure.svg?style=flat-square&maxAge=2592000
[node-badge]: https://img.shields.io/node/v/instsure.svg?style=flat-square


[wtfpl-url]: http://www.wtfpl.net/
[wtfpl-img]: http://www.wtfpl.net/wp-content/uploads/2012/12/wtfpl.svg

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