# oo.js

> For nodejs object oriented helper. util.inherits object compatible.

Latest version **0.0.11** (published 2016-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install oo.js
pnpm add oo.js
yarn add oo.js
bun add oo.js
```

## 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.0.11 |
| Published | 2016-07-15 |
| First published | 2016-03-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Rex Chen |
| Maintainers | chencyr |
| Keywords | oo, object, oriented, js, javascript |

## Links

- npm: https://www.npmjs.com/package/oo.js
- Repository: https://github.com/chencyr/oo.js
- Homepage: https://github.com/chencyr/oo.js#readme
- Issues: https://github.com/chencyr/oo.js/issues
- npm.io page: https://npm.io/package/oo.js

## Dependencies (1)

- [extend](https://npm.io/package/extend.md) ^3.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.11 (latest) — 2016-07-15
- 0.0.10 — 2016-07-12
- 0.0.9 — 2016-07-07
- 0.0.8 — 2016-07-07
- 0.0.7 — 2016-05-09
- 0.0.6 — 2016-03-16
- 0.0.5 — 2016-03-16
- 0.0.4 — 2016-03-15
- 0.0.3 — 2016-03-13
- 0.0.2 — 2016-03-13

## README

# oo.js
For nodejs object oriented helper.
util.inherits object compatible.

# Install
```
npm install -g oo.js
```

# Example Abstract Define.
```
var oo = require('oo.js');
                
var Car = oo.class({
    public: {
        gas: 10,
        getGas: function() {
            return this.gas;
        },
        addGas: function(gas) {
            this.gas = this.gas + gas;
        }
    },

    abstract: [
        "run"
    ]
});

var SuperCar = oo.class({ extends: Car,
    public: {
        run: function() {
            this.gas = this.gas - 1;
        }
    }
});
            
var myCar = new SuperCar();
console.log(myCar.getGas()); // 10
                
myCar.run();
console.log(myCar.getGas()); // 9
                
myCar.addGas(3);
console.log(myCar.getGas()); // 12


```

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