# protect

> protect your object from being overridden

Latest version **0.5.0** (published 2017-12-30) · GPL-3.0 license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2017-12-30 |
| First published | 2014-11-13 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | hex7c0 |
| Maintainers | hex7c0 |
| Keywords | object |

## Links

- npm: https://www.npmjs.com/package/protect
- Repository: https://github.com/hex7c0/protect
- Issues: https://github.com/hex7c0/protect/issues
- npm.io page: https://npm.io/package/protect

## Recent versions

- 0.5.0 (latest) — 2017-12-30
- 0.4.0 — 2017-02-05
- 0.3.0 — 2016-09-12
- 0.2.1 — 2015-11-04
- 0.2.0 — 2015-09-05
- 0.1.1 — 2015-08-01
- 0.1.0 — 2015-03-09
- 0.0.2 — 2014-11-26
- 0.0.1 — 2014-11-13

## README

# [protect](https://github.com/hex7c0/protect)

[![NPM version](https://img.shields.io/npm/v/protect.svg)](https://www.npmjs.com/package/protect)
[![Linux Status](https://img.shields.io/travis/hex7c0/protect.svg?label=linux-osx)](https://travis-ci.org/hex7c0/protect)
[![Windows Status](https://img.shields.io/appveyor/ci/hex7c0/protect.svg?label=windows)](https://ci.appveyor.com/project/hex7c0/protect)
[![Dependency Status](https://img.shields.io/david/hex7c0/protect.svg)](https://david-dm.org/hex7c0/protect)
[![Coveralls](https://img.shields.io/coveralls/hex7c0/protect.svg)](https://coveralls.io/r/hex7c0/protect)

protect your object from being overridden

## Installation

Install through NPM

```bash
npm install protect
```
or
```bash
git clone git://github.com/hex7c0/protect.git
```

## API

inside nodejs project
```js
var protect = require('protect');

var newObj = protect({
    foo: 'ciao'
});

newObj.ciao = 'ciao';
newObj.foo = 123;
```
with this exception
```sh
a.foo = 123;
      ^
TypeError: Cannot assign to read only property 'foo' of [object Object]
```

### protect(obj, [normal])

#### options

 - `obj` - **Object** Your object *(default "required")*
 - `normal` - **Boolean** Using `{}` constructor *(default "Object.create(null)")*

## Examples

Take a look at my [examples](examples)

### [License GPLv3](LICENSE)

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