# augment

> The world's smallest and fastest classical JavaScript inheritance pattern.

Latest version **4.3.1** (published 2019-03-01) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 4.3.1 |
| Published | 2019-03-01 |
| First published | 2012-12-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 858 |
| Author | Aadit M Shah |
| Maintainers | aaditmshah |
| Keywords | augment, augments, augmentation, extend, extends, extension, prototype, prototypal, class, classical, object, inheritance, uber, super, constructor, oop |

## Links

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

## 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

- 4.3.1 (latest) — 2019-03-01
- 4.3.0 — 2014-06-07
- 4.2.0 — 2014-05-27
- 4.0.3 — 2014-05-05
- 4.0.2 — 2014-03-28
- 4.0.1 — 2014-02-26
- 3.3.5 — 2013-11-07
- 3.3.4 — 2013-11-07
- 3.3.3 — 2013-11-07
- 3.3.2 — 2013-08-24
- 3.3.1 — 2013-08-06
- 3.3.0 — 2013-08-06
- 3.2.1 — 2013-04-17
- 3.2.0 — 2013-03-24
- 3.1.0 — 2013-03-24
- … 4 more at https://npm.io/package/augment/versions

## README

# augment #

The world's smallest and fastest classical JavaScript inheritance pattern, `augment`, is a [seven line function](https://github.com/aaditmshah/augment/blob/master/augment.js#L12-L18 "augment.js") which allows you to write [CoffeeScript style classes](http://coffeescript.org/#classes "CoffeeScript") with a flair of [simplicity](http://ejohn.org/blog/simple-javascript-inheritance/ "John Resig -   Simple JavaScript Inheritance"); and it still [beats the bejesus](http://jsperf.com/oop-benchmark/158 "JavaScript Object Oriented Libraries Benchmark · jsPerf") out of other JavaScript inheritance libraries.

Inspired by giants like [Jeremy Ashkenas](http://ashkenas.com/ "Jeremy/Ashkenas — Portfolio") and [John Resig](http://ejohn.org/ "John Resig - JavaScript Programmer"), `augment` is an augmentation of ideas. Classes created using `augment` have a CoffeeScript-like class structure, and a syntax like John Resig's classes; but they are more readable, intuitive and orders of magnitude faster. In addition they work on virtually every JavaScript platform.

## Installation ##

1. You can install `augment` on [node.js](http://nodejs.org/ "node.js") using the [npm](https://npmjs.org/ "npm") command `npm install augment`.
2. You can install `augment` on [RingoJS](http://ringojs.org/ "Home - RingoJS") using the [rp](https://github.com/grob/rp "grob/rp") command `rp install augment`.
3. You can install `augment` for web apps using the [component](https://github.com/component/component "component/component") command `component install javascript/augment`.
4. You can install `augment` for web apps using the [bower](http://bower.io/ "Bower - A package manager for the web") command `bower install augment`.

## Usage ##

1. You can use `augment` as a [CommonJS module](http://wiki.commonjs.org/wiki/Modules "Modules - CommonJS Spec Wiki"):

    ```javascript
    var augment = require("augment"); // module.exports must be supported
    ```

2. You can use `augment` with the [AMD API](https://github.com/amdjs/amdjs-api "Asynchronous Module Definition (AMD) API"):

    ```javascript
    define(["augment"], function (augment) {
        // ....
    });
    ```

3. You can include the latest copy in your web pages, [fiddles](http://jsfiddle.net/ "Create a new Fiddle - jsFiddle") and [benchmarks](http://jsperf.com/ "jsPerf: JavaScript performance playground"):

    ```html
    <script src="https://rawgithub.com/javascript/augment/master/augment.js"></script>
    ```

4. You can browse the [source code](https://github.com/aaditmshah/augment/blob/master/augment.js "javascript/augment") and stick it into your program.

## Manual Pages ##

1. [Getting Started](https://github.com/aaditmshah/augment/wiki/Getting-Started "Getting Started · javascript/augment Wiki")
2. [Classical Inheritance](https://github.com/aaditmshah/augment/wiki/Classical-Inheritance "Classical Inheritance · javascript/augment Wiki")
3. [Prototypal Inheritance](https://github.com/aaditmshah/augment/wiki/Prototypal-Inheritance "Prototypal Inheritance · javascript/augment Wiki")

## License ##

The `augment` library is released under the MIT license. So feel free to modify and distribute it as you wish.

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