# prime

> prime, an OOP JavaScript library for node and the web.

Latest version **0.5.0** (published 2015-05-04) · MIT license · 0 weekly downloads

## Install

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

## 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.5.0 |
| Published | 2015-05-04 |
| First published | 2012-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 155 |
| Author | Valerio Proietti |
| Maintainers | kamicane, arian |
| Keywords | library, framework, es5, class, array, object |

## Links

- npm: https://www.npmjs.com/package/prime
- Repository: https://github.com/kamicane/prime
- Homepage: https://github.com/mootools/prime
- Issues: https://github.com/kamicane/prime/issues
- npm.io page: https://npm.io/package/prime

## Dependencies (1)

- [mout](https://npm.io/package/mout.md) ^0.11.0

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 0.5.0 (latest) — 2015-05-04
- 0.4.2 — 2014-04-08
- 0.4.1 — 2014-03-19
- 0.4.0 — 2014-02-13
- 0.3.2 — 2013-11-30
- 0.3.1 — 2013-11-07
- 0.3.0 — 2013-08-22
- 0.2.1 — 2013-08-02
- 0.2.0 — 2013-07-05
- 0.1.0 — 2013-01-23
- 0.0.6 — 2012-12-06
- 0.0.5-alpha — 2012-04-06
- 0.0.4-alpha — 2012-03-23
- 0.0.3-alpha — 2012-03-22
- 0.0.2-alpha — 2012-03-19
- … 1 more at https://npm.io/package/prime/versions

## README

# ![prime](http://kamicane.github.io/assets/prime.png)

[![Package Info](http://img.shields.io/badge/npm-prime-blue.svg)](https://npmjs.org/package/prime)
[![NPM Version](http://img.shields.io/npm/v/prime.svg)](https://npmjs.org/package/prime)
[![Coverage Status](http://img.shields.io/coveralls/kamicane/prime/master.svg)](https://coveralls.io/r/kamicane/prime)
[![Build Status](http://img.shields.io/travis/kamicane/prime/master.svg)](http://travis-ci.org/kamicane/prime)
[![Dependencies Status](https://david-dm.org/kamicane/prime.svg?theme=shields.io)](https://david-dm.org/kamicane/prime)
[![DevDependencies Status](https://david-dm.org/kamicane/prime/dev-status.svg?theme=shields.io)](https://david-dm.org/kamicane/prime#info=devDependencies)


1. fundamental, basic, essential.
2. make (something) ready for use or action.
3. archetypal, prototypical, typical, classic.

## Description

prime is an Object Oriented JavaScript library. It helps you with prototypal inheritance and contains generic utilities for every-day JavaScripting.

No Native JavaScript Objects were harmed in the making of this library.

## Modules Overview

A short overview of the available modules. For more information, refer to the [documentation](https://github.com/mootools/prime/blob/master/doc/prime.md).

### prime

The function to create new primes.

```js
var prime = require("prime")

var Animal = prime({
    say: function(){
        return "!!"
    }
})

var Emitter = require("prime/emitter")

var Cat = prime({
    inherits: Animal,
    mixin: Emitter,
    say: function(){
        return "meaow" + Cat.parent.say.call(this)
    }
})
```

### prime/emitter

The event emitter.

```js
var Emitter = require("prime/emitter")

var Dog = prime({
    inherits: Animal,
    mixin: Emitter,
    say: function(){
        var word = "wuff" + Dog.parent.say.call(this)
        this.emit("say", word)
        return word
    }
})

var barkley = new Dog

barkley.on("say", function(word){
    console.log("barkley barked", word)
})
```

### prime/map

Map-like implementation.

```js
var Map = require("prime/map")

var map = new Map()

map.set(domElement, "header")
map.set(domElement2, "footer")
map.get(domElement) // "header"
map.get(domElement2) // "footer"
```

### prime/defer

Optimized timeouts / immediates / animationFrames.

```js
var defer = require("prime/defer")

defer.frame(function() {
    console.log('on next animation frame');
});

defer.immediate(function() {
    console.log('on platform next tick.');
});

defer.timeout(function() {
    console.log('late');
}, 500);
```

When all else fails, read the [full documentation](https://github.com/kamicane/prime/blob/master/doc/prime.md).

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