You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
-
# vstorage
1
+
# valistorage
2
2
3
3
A library for efficiently managing data in `localStorage` and `sessionStorage` using **versioning** and **migrations**.
4
4
5
5
# Installation
6
6
7
7
```bash
8
-
npm install vstorage
8
+
npm install valistorage
9
9
```
10
10
11
11
## Creating Storage
@@ -16,7 +16,7 @@ TypeScript allows us to describe the structure of the data we want to store usin
16
16
17
17
18
18
```ts
19
-
import { create } from'vstorage';
19
+
import { create } from'valistorage';
20
20
21
21
interfaceCatVersion1 {
22
22
name:string;
@@ -36,7 +36,7 @@ Let's look at the two required parameters that we passed:
36
36
37
37
## Choosing Storage
38
38
39
-
By default, vstorage uses `localStorage` to store data.
39
+
By default, valistorage uses `localStorage` to store data.
40
40
You can specify the type of storage by providing `type` parameter in `create` function, which accepts either `localStorage` or `sessionStorage`.
41
41
42
42
```ts
@@ -86,7 +86,7 @@ catLocalStorage.remove();
86
86
Imagine that we've decided to add a `color` field to our data structure. Users who have already used the application will only have `name` and `age` stored, so the application won't be able to retrieve `color`.
87
87
88
88
```ts
89
-
import { create } from'vstorage';
89
+
import { create } from'valistorage';
90
90
91
91
interfaceCatVersion1 {
92
92
name:string;
@@ -126,7 +126,7 @@ To ensure the best user experience, we can automatically convert their data to a
126
126
Let's add migrations to our `storage`.
127
127
128
128
```ts
129
-
import { create } from'vstorage';
129
+
import { create } from'valistorage';
130
130
131
131
interfaceCatVersion1 {
132
132
name:string;
@@ -199,7 +199,7 @@ For validating data in storage and migrations, `validate` parameter is used.
199
199
Let's add validation to our previous data structure:
0 commit comments