Easy to Use,
Local Storage Api Wrapper, Easy Storage

Simplifiying the process of using local storage
// ...
db.ref(`project/topsecret/users`).modify((users)=>{
users.push({
name: 'new user',
age: 34,
books: [
{
name: 'Book 1'
},
{
name: 'Book 2'
}
]
})
return users;
});
Less Code
You don't have to write lots of code to set and get data from local storage. Stringifiying the objects or parsing the JSON is no more required!
Tested Package
This package is tested with Mocha, the test code is 10 times larger than the package itself, so you use it safely
Free
Well, I don't want money for sofware i write, but when i don't want it they don't even give a star even though using it! So it's better if you at least give a star if you like this package!
Comparison of Old with LocalDb
Please choose the way you like in the following part
Set Operation
// Each time you set data, you need to set
// the global data
localStorage.setItem(`/`, JSON.stringify({
project1: {
datas:
[
{data: 2.56},
{data: 3.8}}
]
}
));
// You can set required parts of data
db.ref(`project1/datas`).set([
{data: 2.56},
{data: 3.8}
]);
Get Operation
// Fetch all data, then access
const project1 = JSON.parse(localStorage.getItem(`/`));
console.log(`first data: {project1.datas[0}`);
// You don't need to fetch all data but
// only the necessary one
const datas = db.ref(`project1/datas`).get();
console.log(`first data: {datas[0]}`);
Modify Operation
// Well, you need to fetch whole data, change the necessary
// part then set the new whole data. Fetch the data again
// to be sure if the data is modified or not
let project1 = JSON.parse(localStorage.getItem(`/`));
project1.datas[0] = 1.25;
localStorage.setItem(`/`, JSON.stringify(project1));
project1 = JSON.parse(localStorage.getItem(`/`));
console.log(project1.datas[0]) // 1.25
// Modify the only part you want and get the modified data
const datas = db.ref(`project/datas`).modify((datas)=>{
datas[0] = 1.25;
return datas;
});
console.log(datas[0]) // 1.25
You like Easy Storage a lot!
Go to npm. Don't forget to give a star.
You can star the project to support the work!
(Starring is important, because we need support)
Get in touch

Easy to Use,
Local Storage Api Wrapper, Easy Storage

Simplifiying the process of using local storage
// ...
db.ref(`project/topsecret/users`).modify((users)=>{
users.push({
name: 'new user',
age: 34,
books: [
{
name: 'Book 1'
},
{
name: 'Book 2'
}
]
})
return users;
});
Less Code
You don't have to write lots of code to set and get data from local storage. Stringifiying the objects or parsing the JSON is no more required!
Tested Package
This package is tested with Mocha, the test code is 10 times larger than the package itself, so you use it safely
Free
Well, I don't want money for sofware i write, but when i don't want it they don't even give a star even though using it! So it's better if you at least give a star if you like this package!
Comparison of Old with Easy Storage
Please choose the way you like in the following part
Set Operation
// Each time you set data, you need to set
// the global data
localStorage.setItem(`/`, JSON.stringify({
project1: {
datas:
[
{data: 2.56},
{data: 3.8}}
]
}
));
// You can set required parts of data
db.ref(`project1/datas`).set([
{data: 2.56},
{data: 3.8}
]);
Get Operation
// Fetch all data, then access
const project1 = JSON.parse(localStorage.getItem(`/`));
console.log(`first data: {project1.datas[0}`);
// You don't need to fetch all data but
// only the necessary one
const datas = db.ref(`project1/datas`).get();
console.log(`first data: {datas[0]}`);
Modify Operation
// Well, you need to fetch whole data, change the necessary
// part then set the new whole data. Fetch the data again
// to be sure if the data is modified or not
let project1 = JSON.parse(localStorage.getItem(`/`));
project1.datas[0] = 1.25;
localStorage.setItem(`/`, JSON.stringify(project1));
project1 = JSON.parse(localStorage.getItem(`/`));
console.log(project1.datas[0]) // 1.25
// Modify the only part you want and get the modified data
const datas = db.ref(`project/datas`).modify((datas)=>{
datas[0] = 1.25;
return datas;
});
console.log(datas[0]) // 1.25
You like Easy Storage a lot!
Go to npm. Don't forget to give a star.
You can star the project to support the work!
(Starring is important, because we need support)
Get in touch
Go to
Top
Send Mail

Easy Storage

Easy Storage © 2022 All rights reserved.

Easy Storage

Easy Storage © 2022 All rights reserved.
Go to
Top
Send Mail