Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@manojadams/session-store
Advanced tools
A data persistence layer for a react/next-app. It can be also used for state-management (see examples/todo-app)
/**
* Extend SessionStore for session storage
* Extend LocalStore for local storage
*/
class UserStore extends SessionStore {
/**
* Initialize your data
* */
constructor() {
super();
this.users = [];
}
// getters for your data
get users() {
return this.getData("_users");
}
// setter for your data
set users(users: Array<IUser>) {
this.setData("_users", users);
}
/**
* @optional
* Lifecycle hooks
* Put all your startup code here. e.g.=> api calls set data
*/
async init() { // note that init is async
await super.init();
// optional startup logic
// for example: make api calls to set initial data
// this block is also used for depedency management
}
/**
* @optional
* Put all your cleanup code here
*/
destroy() {
// optional cleanup
}
}
export new UserStore();
useEffect(() => {
// initialize store
UserStore.init();
return () => {
// destroy store
UserStore.destroy();
}
}, []);
interface IUser {
name: string;
email: string;
age: number;
gender: string;
}
class UserStore extends SessionStore<IUser> {
}
class UserStore extends SessionStore {
/**
* Initialize your data
* */
constructor() {
super("name_of_your_store", );
this.users = [];
}
}
/**
* Store1, Store2 - name of dependent stores,
* Store1, store 2 will be initialized first before initializing current store
*/
export new UserStore(Store1, Store2);
FAQs
State management with session-storage/local-storage
The npm package @manojadams/session-store receives a total of 1 weekly downloads. As such, @manojadams/session-store popularity was classified as not popular.
We found that @manojadams/session-store 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.