
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Modular & reactive state management framework.
Godam is Hindi word which means godown. The architecture of the framework is similar to godown.
Godam is like a warehouse, where you store all your information. It has rooms which can be used to store data of particular type.
npm i godam
Godam is very generic store framework, which can be used in any front end or backend framework.
We have created official plugin support for below library or frameworks -
Godam has five important parts -
State can be used to store the value.
class MyState{
constructor(){
this.name = "Ujjwal Gupta"
}
}
import {Godam} from "godam";
const myStore = new Godam({
state : MyState
})
myStore.get('name');
Mutation can be used to mutate(change) the state value. Mutation is always synchronous and do not return any result.
import { Godam, Mutation} from "godam";
class MyMutation extends Mutation{
name(value){
this.state.name = value;
}
}
import {Godam} from "godam";
const myStore = new Godam({
state : MyState,
mutation: MyMutation,
})
myStore.set('name', 'Ujjwal kr gupta');
Expression can be used to derive a value from state.
import { Godam, Expression} from "godam";
class MyExpression extends Expression {
get nameLength() {
return this.get('name').length;
}
nameWithPrefix(prefix){
return prefix + this.get('name')
}
}
import {Godam} from "godam";
const myStore = new Godam({
state : MyState,
mutation: MyMutation,
expression: MyExpression
})
myStore.eval('nameLength');
myStore.eval('nameWithPrefix', 'hello');
Computed are expressions which are cached. So they will be called only when state changes.
Computed can be used to increase performance.
Computed can not accept parameters.
import { Godam, Expression} from "godam";
class MyExpression extends Expression {
// nameLength will be called only name is changed
@Computed('name')
get nameLength() {
return this.get('name').length;
}
}
or
import { Godam, Expression} from "godam";
class MyExpression extends Expression {
constructor(){
this.markComputed("nameLength", 'name');
}
get nameLength() {
return this.get('name').length;
}
}
Any logic which requires lots of store manipulation can be created as task. A Task has access to - state , mutation, expression.
Task can be made asychronous by returning promise.
import {Task} from "godam";
class MyTask extends Task {
saveInfo(name){
const savedName = this.get('name');
if(name!=savedName){
this.set('name', name);
}
const payload = {
name : name,
count: this.eval('nameCount')
}
}
}
import {Godam} from "godam";
const myStore = new Godam({
state : MyState,
mutation: MyMutation,
expression: MyExpression,
task: MyTask
})
myStore.do('saveInfo', 'hello world');
Room can be used to modularized the store.
import { Godam, Mutation, Room } from "godam";
class AccountState {
id = ""
}
class AccountMutation extends Mutation{
id(value) {
this.state.id = value;
}
}
const accountRoom = new Room({
state: AccountState,
mutation: AccountMutation
})
const myStore = new Godam({
state : MyState,
mutation: MyMutation,
expression: MyExpression,
task: MyTask,
rooms: {
account: accountRoom
}
})
myStore.get('id@account');
myStore.set('id@account', 1);
myStore.eval('<expression name>@<room>');
myStore.do('<task name>@<room>');
FAQs
Modular & reactive state management framework
We found that godam demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.