Easy data manipulation to get, emit, set, compute and observe

Usage no npm install needed!

<script type="module">
  import gesco from '';


gesco npm version npm downloads

Easy data manipulation to get, emit, set, compute and observe.


$ npm install gesco


gesco.get<T = any>(path: PathLike): T

Get the value stored in the path.


gesco.delete(path: PathLike, silently: boolean = false)

Delete the value stored in the path. See silence.


gesco.emit<T = any>(path: PathLike: callback?: EmitCallback<T>)

Bubbles the value changes. See bubbles.

gesco.emit('foo', foo => {

Since changing a property directly or using array methods won't bubble, this allows you to indicate to Gesco that there has been a change/transformation. Use callback to perform operations like that.

gesco.set<T = any>(path: PathLike, value: any, silently: boolean = false): void

Stores a value in the path. See silence.

gesco.set('foo', 'bar');

gesco.observe<T = any>(from: PathLike, callback: ObserverCallback<T>): void

Observe the path and the descending paths.

gesco.observe('', bar => {
    console.log('bar has changed:', bar);

gesco.compute<T = any>(to: PathLike, from: PathLike, callback: ComputerCallback<T>): void

Compute the path and the descending paths.

gesco.compute('newBar', '', bar => bar.toUpperCase()); PathLike, to: PathLike, bidirectional: boolean = false)

Links two different paths.'path1', 'path2');


This term refers to triggering the direct and indirect observers/computers of a path.

The methods set, delete and emit bubble the value changes automatically when invoked.


This term refers to prevent bubbling the value changes.


When a value is changed, the change propagates to the path itself and its descendants. For example, changing foo will trigger:

  • foo


MIT © Isaac Ferreira