{"id":28347908,"url":"https://github.com/eimfach/frozen-core","last_synced_at":"2026-03-14T06:33:14.091Z","repository":{"id":24392339,"uuid":"27792403","full_name":"eimfach/frozen-core","owner":"eimfach","description":"frozen-core.js - immutable objects","archived":false,"fork":false,"pushed_at":"2018-09-10T14:20:12.000Z","size":42,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-11T14:12:51.697Z","etag":null,"topics":["experimental","immutable","javascript","object-creation","opinionated"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eimfach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-09T23:20:54.000Z","updated_at":"2019-07-20T17:11:08.000Z","dependencies_parsed_at":"2022-08-21T08:00:57.070Z","dependency_job_id":null,"html_url":"https://github.com/eimfach/frozen-core","commit_stats":null,"previous_names":["eimfach/capsule-js"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eimfach/frozen-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eimfach%2Ffrozen-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eimfach%2Ffrozen-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eimfach%2Ffrozen-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eimfach%2Ffrozen-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eimfach","download_url":"https://codeload.github.com/eimfach/frozen-core/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eimfach%2Ffrozen-core/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260589715,"owners_count":23032941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["experimental","immutable","javascript","object-creation","opinionated"],"created_at":"2025-05-27T17:40:43.706Z","updated_at":"2026-03-14T06:33:14.084Z","avatar_url":"https://github.com/eimfach.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# frozen-core\n![](https://travis-ci.org/eimfach/frozen-core.svg?branch=master)\n[![Coverage Status](https://coveralls.io/repos/eimfach/capsule-js/badge.svg?branch=master)](https://coveralls.io/r/eimfach/capsule-js?branch=master)\n![](https://david-dm.org/eimfach/frozen-core.svg)\n[![Code Climate](https://codeclimate.com/github/eimfach/capsule-js/badges/gpa.svg)](https://codeclimate.com/github/eimfach/capsule-js)\n\nExperimental lib to create immutable objects and structures in a very opinionated way.\n\n- Very small (4KB, raw)\n- Object properties are immutable\n- Optional state properties\n- Simple Typesafe inheritance\n- Hierarchic method bubbling\n- Enforces a specifc way to implement your Objects and Methods\n\n```javascript\nvar frozenCore = require('frozen-core');\nvar myObject = frozenCore.extend({\n  state: {\n    //mutable property values (the object mask)`\n  },\n  core: {\n    // immutable property values here\n    //only functions allowed (other types are ommited)\n    // 'shares' the state object scope by obtaining a immutable copy (the snapshot) (lexical this refers to that snapshot)\n    /* Every method here only can access that copy but no other method within \n    the object except the inherited public api methods (extend, bubble) */\n  }\n})\n// the properties of the resulting object are always immutable, not configurable as the object itself too, one can't add new properties, remove or configure them\n```\n## API \n```javascript\nmyObject.extend(/*options object*/);\nmyObject.bubble(/*method to call (which will be executed on every parent)*/)\nmyObject.getSnapshot() //returns a reference to the immutable state copy\nmyObject.parent // reference to the latest origin\n```\n\n## Simple implementation example\n\n```javascript\nvar cube = frozenCore.extend({\n  core: {\n    mutate: function(){\n      //'this' is safe to use here since it will be immutable - it will refer to a copy of the state object\n      /* this will have no effect except throwing an error in strict mode !*/this.width = 1;\n      return this.extend({\n        state: {\n          width: this.width+20,\n          height: this.height+20,\n          depth: this.depth+20\n        }\n      });\n    }\n  },\n  state: {\n    width: 0,\n    height: 0,\n    depth: 0\n  }\n});\n\nvar mutatedCube = cube.mutate();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feimfach%2Ffrozen-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feimfach%2Ffrozen-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feimfach%2Ffrozen-core/lists"}