Installations
npm install ngx-dexie-observable
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
12.5.0
NPM Version
6.9.0
Score
71.7
Supply Chain
97.9
Quality
75.4
Maintenance
50
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (100%)
Developer
rosostolato
Download Statistics
Total Downloads
1,269
Last Day
1
Last Week
1
Last Month
5
Last Year
114
GitHub Statistics
1 Stars
18 Commits
2 Branches
1 Contributors
Bundle Size
73.86 kB
Minified
22.97 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.0-beta.6
Package Id
ngx-dexie-observable@1.0.0-beta.6
Unpacked Size
25.31 kB
Size
5.01 kB
File Count
14
NPM Version
6.9.0
Node Version
12.5.0
Total Downloads
Cumulative downloads
Total Downloads
1,269
Last day
0%
1
Compared to previous day
Last week
0%
1
Compared to previous week
Last month
66.7%
5
Compared to previous month
Last year
-42.1%
114
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
Dev Dependencies
27
ngx-dexie-observable
Dexie module for Angular 2.0+ projects
This is a fork of ngx-dexie with rxjs observable implementation
Install
npm install ngx-dexie-observable --save
How to use
Import and configure DexieModule
1//... 2import { DexieModule, DexieConfig } from 'ngx-dexie'; 3 4const config: DexieConfig = { 5 databaseName: 'AppDatabase',//your database name here 6 schema: { 7 friends: '++id, first_name, last_name', 8 teachers: '++id, first_name, last_name' 9 } // any schema of your choice 10}; 11 12@NgModule({ 13 declarations: [ 14 AppComponent 15 ], 16 imports: [ 17 BrowserModule, 18 DexieModule.forRoot(config) 19 ], 20 providers: [ 21 22 ], 23 bootstrap: [AppComponent] 24}) 25 26export class AppModule { }
Using your dexie instance
The DexieModule
provides now a configured Dexie db instance and a Dexie db service, i.e. DexieService
which can be injected anywhere inside the AppModule
.
1import { Injectable } from '@angular/core'; 2import { DexieService } from 'ngx-dexie'; 3 4@Injectable() 5export class IndexedDbService { 6 7 constructor(private dexieService: DexieService) {} 8 9 addOneFriend(friendObject: Object) { 10 this.dexieService.addOne('friends', friendObject); 11 } 12 13}
API
dexieService.addOne(table: string, object: Object)
Adds the entry object
to the dexie table table
Returns a promise which when resolved gives the key of the object added, when rejected gives the error that occured.
dexieService.addMultiple(table: string, objects: Object[])
Adds multiple objects
to the dexie table table
Returns a promise which works similar to Dexie bulkAdd()
dexieService.count(table: string)
Returns a promise which when resolved gives the number of objects in the table table
dexieService.addOrUpdateOne(table: string, object: Object, key?: any)
Works similar to Dexie put()
dexieService.addOrUpdateMultiple(table: string, objects: Object[], keys?: any)
Works similar to Dexie bulkPut()
dexieService.deleteOne(table: string, primaryKey: any)
Works similar to Dexie delete()
dexieService.deleteMultiple(table: string, primaryKeys: any[])
Works similar to Dexie bulkDelete()
dexieService.clearAll(table: string)
Works similar to Dexie clear()
dexieService.operateOnEach(table: string, callback: (item: any, idbCursor: any) => any)
Works similar to Dexie each()
dexieService.filter(table: string, filterFunction: (value: any) => boolean)
Works similar to Dexie filter()
dexieService.getByPrimaryKey(table: string, primaryKey: any, callback?: (item: Object) => any)
Works similar to Dexie get()
dexieService.getByKeyToValueMap(table: string, keyValueMap: Object, callback?: (item: Object) => any)
Works similar to Dexie get()
dexieService.getFirstNItemsOfTable(table: string, num: number)
Works similar to Dexie limit()
dexieService.orderBy(table: string, index: string)
Works similar to Dexie orderBy()
dexieService.offset(table: string, ignoreUpto: number)
Works similar to Dexie offset()
dexieService.reverse(table: string)
Works similar to Dexie reverse()
dexieService.toArray(table: string, callback?: (objects: Object[]) => any)
Works similar to Dexie toArray()
dexieService.toCollection(table: string)
Works similar to Dexie toCollection()
dexieService.update(table: string, key: any, changes: Object)
Works similar to Dexie update()
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/18 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
2.6
/10
Last Scanned on 2025-01-06
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More