🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

@webkrafters/auto-immutable

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webkrafters/auto-immutable

Auto Immutable - self enforcing immutable data structure

latest
Source
npmnpm
Version
2.0.5
Version published
Maintainers
1
Created
Source

Auto Immutable JS

Introduction

Auto Immutable JS is a self enforcing immutable class. Its internal data are private and readonly.

It provides Consumer instances through which it can be read and updated.

Name:

@webkrafters/auto-immutable
Alternate: auto-immutable.js

Installation

npm install --save @webkrafters/auto-immutable

Quick Start

Please see Full documentation before using. Recommended.

Obtain an Immutable Instance

/* my-immutable.ts */

import AutoImmutable from '@webkrafters/auto-immutable';

const initValue = { a: { b: { c: 24 } } };

const aImmutable = new AutoImmutable( initValue );

export default aImmutable;

Connect to an AutoImmutable Instance

/* read-my-immutable.ts */

import myImmutable from './my-immutable';

const consumer = myImmutable.connect();

const objectPaths = [ 'a.b.c', 'a.b' ];

const data : AccessorResponse = consumer.get( ...objectPaths );
// => data = {
//   'a.b': { c: 24 },
//   'a.b.c': 24
// }

Manually Discard an AutoImmutable Consumer.

consumer.disconnect();

Manually Discard an AutoImmutable Instance.

myImmutable.close();

License

MIT

Keywords

auto-immutable

FAQs

Package last updated on 20 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts