<commit_before><img src="https://raw.githubusercontent.com/stampit-org/stampit-logo/master/stampit-logo.png" alt="stampit" width="320" />
-----
[![Travis-CI](https://travis-ci.org/stampit-org/stampit.svg)](https://travis-ci.org/stampit-org/stampit)[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/stampit-org/stampit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Create objects from reusable, composable behaviors. Stampit uses [three different kinds of prototypal OO](http://ericleads.com/2013/02/fluent-javascript-three-different-kinds-of-prototypal-oo/) to let you inherit behavior in a way that is much more powerful and flexible than classical OO.

Stampit was written as an example for the book, ["Programming JavaScript Applications" (O'Reilly)](http://pjabook.com).

Looking for a deep dive into prototypal OO, stamps, and the Two Pillars of JavaScript? [Learn JavaScript with Eric Elliott](https://ericelliottjs.com).

**React Users.** Stampit *loves* React. Check out [react-stampit](https://github.com/stampit-org/react-stampit) for composable components.


## Status

**v1, stable,** in production use with millions of monthly users. There will be no breaking changes in the 1.x line.

**v2, current stable**. Breaking changes:
* `stampit()` now receives options object (`{methods,refs,init,props,static}`) instead of multiple arguments.
* All chaining methods return new stamps instead of self-mutating `this` stamp.
* `state()` always shallow merge properties. It was not doing so in a single rare case.
* Instead of factory arguments the `enclose()` functions now receives the following object `{ instance, stamp, args }`.

There is a slight chance these changes affect your current codebase. If so, we would recommend you to update to v2 because it is more powerful.
See [advances examples](docs/advanced_examples.md).


## Install
<commit_msg>Reference the v2 release breaking changes instead of keeping the list in the README header.<commit_after><img src="https://raw.githubusercontent.com/stampit-org/stampit-logo/master/stampit-logo.png" alt="stampit" width="320" />
-----
[![Travis-CI](https://travis-ci.org/stampit-org/stampit.svg)](https://travis-ci.org/stampit-org/stampit)[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/stampit-org/stampit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Create objects from reusable, composable behaviors. Stampit uses [three different kinds of prototypal OO](http://ericleads.com/2013/02/fluent-javascript-three-different-kinds-of-prototypal-oo/) to let you inherit behavior in a way that is much more powerful and flexible than classical OO.

Stampit was written as an example for the book, ["Programming JavaScript Applications" (O'Reilly)](http://pjabook.com).

Looking for a deep dive into prototypal OO, stamps, and the Two Pillars of JavaScript? [Learn JavaScript with Eric Elliott](https://ericelliottjs.com).

**React Users.** Stampit *loves* React. Check out [react-stampit](https://github.com/stampit-org/react-stampit) for composable components.


## Status

* **v1, stable,** in production use with millions of monthly users. There will be no breaking changes in the 1.x line.
* **v2, current stable**. See breaking changes and new features on the 
[releases page](https://github.com/stampit-org/stampit/releases/tag/2.0).


## Install

{'fraction_non_alphanumeric': 0.12727272727272726, 'fraction_numerical': 0.008211143695014663, 'mean_word_length': 5.168173598553345, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 15, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3560216', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1054, 'n_words': 320}