Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ionic/storage

Package Overview
Dependencies
Maintainers
8
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ionic/storage - npm Package Compare versions

Comparing version 1.1.2 to 1.1.6

62

es2015/storage.d.ts
/**
* Storage is an easy way to store key/value pairs and other complicated
* data in a way that uses a variety of storage engines underneath. Currently,
* Storage uses localforage underneath to abstract away the various storage
* engines while still providing a simple API.
* Storage is an easy way to store key/value pairs and JSON objects.
* Storage uses a variety of storage engines underneath, picking the best one available
* depending on the platform.
*
* When running natively, Storage will prioritize using SQLite, as it's one of
* When running in a native app context, Storage will prioritize using SQLite, as it's one of
* the most stable and widely used file-based databases, and avoids some of the
* pitfalls of things like localstorage that the OS can decide to clear out in
* low disk-space situations.
* pitfalls of things like localstorage and IndexedDB, such as the OS deciding to clear out such
* data in low disk-space situations.
*
* When running in the web or as a Progressive Web App, Storage will attempt to use
* IndexedDB, WebSQL, and localstorage, in that order.
*
* @usage
* First, if you'd like to use SQLite, install the cordova-sqlite-storage plugin:
* ```bash
* cordova plugin add cordova-sqlite-storage --save
* ```
*
* Next, install the package (comes by default for Ionic 2 apps >= RC.0)
*
* ```bash
* npm install --save @ionic/storage
* ```
*
* Next, add it to the providers list in your `NgModule` declaration (for example, in `src/app.module.ts`):
*
* ```typescript
import { Storage } from '@ionic/storage';
@NgModule({
declarations: [
// ...
],
imports: [
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
// ...
],
providers: [
Storage
]
})
export class AppModule {}
*```
*
* Finally, inject it into any of your components or pages:
* ```typescript
* import { Storage } from '@ionic/storage';
* export class MyApp {
* constructor(storage: Storage) {
* storage.set('name', 'Max');
* storage.get('name').then((val) => {
* console.log('Your name is', val);
* })
* }
* }
* ```
*/

@@ -15,0 +63,0 @@ export declare class Storage {

@@ -11,18 +11,66 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

/**
* Storage is an easy way to store key/value pairs and other complicated
* data in a way that uses a variety of storage engines underneath. Currently,
* Storage uses localforage underneath to abstract away the various storage
* engines while still providing a simple API.
* Storage is an easy way to store key/value pairs and JSON objects.
* Storage uses a variety of storage engines underneath, picking the best one available
* depending on the platform.
*
* When running natively, Storage will prioritize using SQLite, as it's one of
* When running in a native app context, Storage will prioritize using SQLite, as it's one of
* the most stable and widely used file-based databases, and avoids some of the
* pitfalls of things like localstorage that the OS can decide to clear out in
* low disk-space situations.
* pitfalls of things like localstorage and IndexedDB, such as the OS deciding to clear out such
* data in low disk-space situations.
*
* When running in the web or as a Progressive Web App, Storage will attempt to use
* IndexedDB, WebSQL, and localstorage, in that order.
*
* @usage
* First, if you'd like to use SQLite, install the cordova-sqlite-storage plugin:
* ```bash
* cordova plugin add cordova-sqlite-storage --save
* ```
*
* Next, install the package (comes by default for Ionic 2 apps >= RC.0)
*
* ```bash
* npm install --save @ionic/storage
* ```
*
* Next, add it to the providers list in your `NgModule` declaration (for example, in `src/app.module.ts`):
*
* ```typescript
import { Storage } from '@ionic/storage';
@NgModule({
declarations: [
// ...
],
imports: [
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
// ...
],
providers: [
Storage
]
})
export class AppModule {}
*```
*
* Finally, inject it into any of your components or pages:
* ```typescript
* import { Storage } from '@ionic/storage';
* export class MyApp {
* constructor(storage: Storage) {
* storage.set('name', 'Max');
* storage.get('name').then((val) => {
* console.log('Your name is', val);
* })
* }
* }
* ```
*/
export var Storage = (function () {
function Storage() {
// TODO: Remove this once we figure out our proper build
var _this = this;
this._db = LocalForage;

@@ -33,8 +81,10 @@ this._db.config({

});
this._db.setDriver([
this._db.defineDriver(CordovaSQLiteDriver).then(function () { return _this._db.setDriver([
CordovaSQLiteDriver._driver,
this._db.INDEXEDDB,
this._db.WEBSQL,
this._db.LOCALSTORAGE
]);
_this._db.INDEXEDDB,
_this._db.WEBSQL,
_this._db.LOCALSTORAGE
]); }).then(function () {
console.info('Ionic Storage driver:', _this._db.driver());
});
}

@@ -41,0 +91,0 @@ /**

/**
* Storage is an easy way to store key/value pairs and other complicated
* data in a way that uses a variety of storage engines underneath. Currently,
* Storage uses localforage underneath to abstract away the various storage
* engines while still providing a simple API.
* Storage is an easy way to store key/value pairs and JSON objects.
* Storage uses a variety of storage engines underneath, picking the best one available
* depending on the platform.
*
* When running natively, Storage will prioritize using SQLite, as it's one of
* When running in a native app context, Storage will prioritize using SQLite, as it's one of
* the most stable and widely used file-based databases, and avoids some of the
* pitfalls of things like localstorage that the OS can decide to clear out in
* low disk-space situations.
* pitfalls of things like localstorage and IndexedDB, such as the OS deciding to clear out such
* data in low disk-space situations.
*
* When running in the web or as a Progressive Web App, Storage will attempt to use
* IndexedDB, WebSQL, and localstorage, in that order.
*
* @usage
* First, if you'd like to use SQLite, install the cordova-sqlite-storage plugin:
* ```bash
* cordova plugin add cordova-sqlite-storage --save
* ```
*
* Next, install the package (comes by default for Ionic 2 apps >= RC.0)
*
* ```bash
* npm install --save @ionic/storage
* ```
*
* Next, add it to the providers list in your `NgModule` declaration (for example, in `src/app.module.ts`):
*
* ```typescript
import { Storage } from '@ionic/storage';
@NgModule({
declarations: [
// ...
],
imports: [
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
// ...
],
providers: [
Storage
]
})
export class AppModule {}
*```
*
* Finally, inject it into any of your components or pages:
* ```typescript
* import { Storage } from '@ionic/storage';
* export class MyApp {
* constructor(storage: Storage) {
* storage.set('name', 'Max');
* storage.get('name').then((val) => {
* console.log('Your name is', val);
* })
* }
* }
* ```
*/

@@ -15,0 +63,0 @@ export declare class Storage {

@@ -12,18 +12,66 @@ "use strict";

/**
* Storage is an easy way to store key/value pairs and other complicated
* data in a way that uses a variety of storage engines underneath. Currently,
* Storage uses localforage underneath to abstract away the various storage
* engines while still providing a simple API.
* Storage is an easy way to store key/value pairs and JSON objects.
* Storage uses a variety of storage engines underneath, picking the best one available
* depending on the platform.
*
* When running natively, Storage will prioritize using SQLite, as it's one of
* When running in a native app context, Storage will prioritize using SQLite, as it's one of
* the most stable and widely used file-based databases, and avoids some of the
* pitfalls of things like localstorage that the OS can decide to clear out in
* low disk-space situations.
* pitfalls of things like localstorage and IndexedDB, such as the OS deciding to clear out such
* data in low disk-space situations.
*
* When running in the web or as a Progressive Web App, Storage will attempt to use
* IndexedDB, WebSQL, and localstorage, in that order.
*
* @usage
* First, if you'd like to use SQLite, install the cordova-sqlite-storage plugin:
* ```bash
* cordova plugin add cordova-sqlite-storage --save
* ```
*
* Next, install the package (comes by default for Ionic 2 apps >= RC.0)
*
* ```bash
* npm install --save @ionic/storage
* ```
*
* Next, add it to the providers list in your `NgModule` declaration (for example, in `src/app.module.ts`):
*
* ```typescript
import { Storage } from '@ionic/storage';
@NgModule({
declarations: [
// ...
],
imports: [
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
// ...
],
providers: [
Storage
]
})
export class AppModule {}
*```
*
* Finally, inject it into any of your components or pages:
* ```typescript
* import { Storage } from '@ionic/storage';
* export class MyApp {
* constructor(storage: Storage) {
* storage.set('name', 'Max');
* storage.get('name').then((val) => {
* console.log('Your name is', val);
* })
* }
* }
* ```
*/
var Storage = (function () {
function Storage() {
// TODO: Remove this once we figure out our proper build
var _this = this;
this._db = localforage_1.default;

@@ -34,8 +82,10 @@ this._db.config({

});
this._db.setDriver([
this._db.defineDriver(localforage_cordovasqlitedriver_1.default).then(function () { return _this._db.setDriver([
localforage_cordovasqlitedriver_1.default._driver,
this._db.INDEXEDDB,
this._db.WEBSQL,
this._db.LOCALSTORAGE
]);
_this._db.INDEXEDDB,
_this._db.WEBSQL,
_this._db.LOCALSTORAGE
]); }).then(function () {
console.info('Ionic Storage driver:', _this._db.driver());
});
}

@@ -42,0 +92,0 @@ /**

7

package.json
{
"name": "@ionic/storage",
"version": "1.1.2",
"version": "1.1.6",
"description": "Ionic Storage utility",

@@ -13,3 +13,4 @@ "main": "es2015/index.js",

"preparePackage": "node ./scripts/copy-package",
"build": "npm run clean && npm run build-cjs && npm run build-es2015 && npm run preparePackage"
"build": "npm run clean && npm run build-cjs && npm run build-es2015 && npm run preparePackage",
"publishPackage": "npm run build && cd dist && npm publish"
},

@@ -37,5 +38,5 @@ "repository": {

"localforage": "^1.4.2",
"localforage-cordovasqlitedriver": "driftyco/localforage-cordovasqlitedriver#9803562a61c2172a69f3475f97e98922c0b49ac0",
"localforage-cordovasqlitedriver": "^1.5.0",
"rxjs": "5.0.0-beta.12"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc