๐Ÿš€ Quick Start

๐Ÿš€ Quick Start with @fizzwiz/vanilla

@fizzwiz/vanilla provides simple, semantic helpers for working with plain JSON objects. Below are examples to get you started quickly.


Installation

npm install @fizzwiz/vanilla

OptionStore Example

Store and retrieve options by type, automatically walking up an instance's prototype chain.

import { OptionStore } from '@fizzwiz/vanilla';

class Base {}
class Derived extends Base {}

const options = OptionStore.as({});
options.set(Base, 'color', 'blue');
options.get(Derived, 'color'); // -> 'blue'

Notes

  • Useful for per-type configuration.
  • Automatically resolves values from the prototype chain.

ObjNavigator Example

Navigate and manipulate nested objects using paths or functions.

import { ObjNavigator } from '@fizzwiz/vanilla';

const navigator = ObjNavigator.from({})
  .set('user.profile.name', 'Alice')  
  .with('user.profile')
    .set('age', 30)
    .set('email', 'alice@example.com')
  .without();

Notes

  • Simplifies working with deeply nested objects without manual intermediate checks.
  • Supports scoped navigation with within() / with() and returning to parent via without().
  • Works with plain JSON objects; fully serializable and flexible.

Comments

Popular posts from this blog

๐ŸŒ Plain JavaScript Objects — the True Language of Distributed Systems

๐Ÿงฑ v0.0.0-dev.1 — First Brick

๐Ÿฆ v0.0.0-dev.2 — Sweet Refinements