# objy

> A JavaScript framework for building object-driven applications

Latest version **0.7.241** (published 2026-11-10) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.7.241 |
| Published | 2026-11-10 |
| First published | 2020-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 1.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Marco Boelling |
| Maintainers | marcoboelling |
| Keywords | platform, javascript, objects |

## Links

- npm: https://www.npmjs.com/package/objy
- Repository: https://github.com/objy-org/objy
- Homepage: https://objy.xyz
- Issues: https://github.com/objy-org/objy/issues
- npm.io page: https://npm.io/package/objy

## Dependencies (2)

- [moment](https://npm.io/package/moment.md) ^2.24.0
- [shortid](https://npm.io/package/shortid.md) ^2.2.15

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.7.241 (latest) — 2026-11-10
- 0.6.73 (beta) — 2021-06-02
- 0.7.240 — 2026-10-11
- 0.7.239 — 2026-10-11
- 0.7.238 — 2026-10-11
- 0.7.237 — 2026-01-28
- 0.7.235 — 2025-12-11
- 0.7.234 — 2025-12-11
- 0.7.233 — 2025-12-08
- 0.7.232 — 2025-12-02
- 0.7.231 — 2025-12-02
- 0.7.230 — 2025-12-01
- 0.7.229 — 2025-11-28
- 0.7.228 — 2025-01-29
- 0.7.227 — 2025-01-14
- … 117 more at https://npm.io/package/objy/versions

## README

# OBJY - Abstract, powerful JavaScript objects

An object-driven programming framework, that uses behaviour-driven objects for building use cases. 

<a href="https://objy.xyz/#/DOCUMENTATION.md" style="border: 1px solid #AAAAAA;
    padding: 5px 10px;
    border-radius: 100px;
    text-decoration: none;">FULL DOCUMENTATION</a>

![OBJY LOGO](https://objy.xyz/assets/img/objy-arch-objects-slim.png "OBJY")

OBJY Objects:

* are plain JavaScript objects
* have dynamic origins
* have behaviour
* and more...


# Installing

***Node***

```shell
npm install objy
```

***Browser***

```html
<script src="https://cdn.jsdelivr.net/npm/objy/dist/browser.js">
```

# Quick example

Programming on OBJY is done in two simple steps:

1. Define an object family (a bucket of objects)
2. Build and handle objects and tell them what to do.


```javascript
// 1. Define Object Family
OBJY.define({
   name: "object", // singular constructor name
   pluralName: "objects" // plural constructor name
})

// 2. Use objects
OBJY.object({
   expired: false,
   expiration_date: {
      date: "12/31/2022",
      action: () => {
         obj.setProperty('expired', true).update();
      }
   },
   maintenance: {
      interval: "1PY",
      action: () => {
         console.log('annually maintenence');
      }
   }
})
```


# Handling objects

Objects are handled using an OBJY wrapper: OBJY.object().

```javascript
// Create an object (onCreate handlers will trigger)
var myObj = OBJY.object({
   name: "Hello"
}).add();

// Update an object (onChange handlers will trigger)
myObj.name = "Hello World";

// or use the built-in methods:
myObj.addProperty('color', 'blue');

// Delete an object (onDelete handlers will trigger)
myObj.remove();
```

# Date or interval-based events:

Events can either have a date or an interval. OBJY takes care of running the associated action.

```javascript
OBJY.object({
   ...
   expiration_date: {
      date: "12/31/2022",
      action: () => {
         obj.setProperty('expired', true).update();
      }
   },
   maintenance: {
      interval: "1PY",
      action: () => {
         console.log('annually maintenence');
      }
   }
})
```

# Handlers

Use onCreate, onChange or onDelete to capture these events and OBJY runs a custom action.

```javascript
OBJY.object({
   ...
   onDelete: {
      quit: {
         action: () => {
            console.log('Im now gone...')
         }}
   }
})
```

# Inheritance

```javascript
// first object
OBJY.object({
   _id: 123,
   type: "yogurt"
})
// second object that inherits from first object
// inherit from one or more other objects using their id
OBJY.object({
   ... 
   inherits: [123], 
   // type: "yogurt" and all other props are present here
})
``` 

# Querying objects

Every object you create lives inside the OBJY instance. For accessing and working with all your objects, OBJY offers the following built-in query API:

```javascript
// Query all active objects
OBJY.objects({json query}).get(objects => {
   console.log(objects) // an array containing the matched objects
})
```


# Custom Mappers

```javascript
OBJY.define({
   ...
   // Attach your own storage (can be anything that supports crud)
   storage: OBJY.customStorage({
      add: () => {},
      getById: () => {},
      ...
   }),
   // Customize, how actions are executed
   processor: OBJY.customProcessor({
      execute: (action) => {}, 
      ...
   }),
   // Observe events yourself
   observer: OBJY.customObserver({
      run: () => {}
   })
})
```

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