Comparing version 2.4.0 to 2.4.1
{ | ||
"name": "vue-ls", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "Vue plugin for work with LocalStorage from Vue context", | ||
@@ -35,2 +35,3 @@ "main": "dist/vue-ls.js", | ||
"keywords": [ | ||
"storage", | ||
"localstorage", | ||
@@ -42,2 +43,10 @@ "local-storage", | ||
"vuejs-local-storage", | ||
"memorystroage", | ||
"sessionstorage", | ||
"session-storage", | ||
"vue-sessionstorage", | ||
"vuejs-sessionstorage", | ||
"vue-session-storage", | ||
"vuejs-session-storage", | ||
"memory-stroage", | ||
"vue-ls", | ||
@@ -44,0 +53,0 @@ "vue", |
@@ -37,3 +37,3 @@ <p align="center"> | ||
Vue plugin for work with LocalStorage from Vue context | ||
Vue plugin for work with local storage, session storage and memory storage from Vue context | ||
@@ -85,15 +85,17 @@ [![NPM](https://nodei.co/npm/vue-ls.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/vue-ls/) | ||
Vue localStorage API. | ||
Vue storage API. | ||
``` js | ||
import VueLocalStorage from 'vue-ls'; | ||
import Storage from 'vue-ls'; | ||
options = { | ||
namespace: 'vuejs__' | ||
namespace: 'vuejs__', // key prefix | ||
name: 'ls', // name variable Vue.[ls] or this.[$ls], | ||
storage: 'local', // storage name session, local, memory | ||
}; | ||
Vue.use(VueLocalStorage, options); | ||
Vue.use(Storage, options); | ||
//or | ||
//Vue.use(VueLocalStorage); | ||
//Vue.use(Storage); | ||
@@ -132,3 +134,3 @@ new Vue({ | ||
Returns value under `name` in local storage. Internally parses the value from JSON before returning it. | ||
Returns value under `name` in storage. Internally parses the value from JSON before returning it. | ||
@@ -139,3 +141,3 @@ - `def`: default null, returned if not set `name`. | ||
Persists `value` under `name` in local storage. Internally converts the `value` to JSON. | ||
Persists `value` under `name` in storage. Internally converts the `value` to JSON. | ||
@@ -146,7 +148,7 @@ - `expire`: default null, life time in milliseconds `name` | ||
Removes `name` from local storage. Returns `true` if the property was successfully deleted, and `false` otherwise. | ||
Removes `name` from storage. Returns `true` if the property was successfully deleted, and `false` otherwise. | ||
#### `Vue.ls.clear()` | ||
Clears local storage. | ||
Clears storage. | ||
@@ -157,4 +159,4 @@ #### `Vue.ls.on(name, callback)` | ||
- `newValue`: the current value for `name` in local storage, parsed from the persisted JSON | ||
- `oldValue`: the old value for `name` in local storage, parsed from the persisted JSON | ||
- `newValue`: the current value for `name` in storage, parsed from the persisted JSON | ||
- `oldValue`: the old value for `name` in storage, parsed from the persisted JSON | ||
- `url`: the url for the tab where the modification came from | ||
@@ -161,0 +163,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35957
186