Socket
Socket
Sign inDemoInstall

nedb-async

Package Overview
Dependencies
106
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.8 to 0.0.9

1

dist/index.d.ts

@@ -12,2 +12,3 @@ import * as Nedb from "nedb";

asyncRemoveIndex(fieldName: string): Promise<{}>;
asyncLoadDatabase(): Promise<{}>;
}

@@ -33,3 +33,10 @@ "use strict";

}
asyncLoadDatabase() {
return new Promise((resolve, reject) => {
this.loadDatabase((err) => {
err ? reject(err) : resolve(true);
});
});
}
}
exports.default = AsyncNedb;

49

index.ts

@@ -11,23 +11,30 @@ import * as Nedb from "nedb";

}
asyncCount(query: any) {
return promisefy.call(this, 'count', arguments)
asyncCount(query: any) {
return promisefy.call(this, 'count', arguments)
}
asyncFindOne<T>(query: any, projection?: T) {
return promisefy.call(this, 'findOne', arguments) as Promise<T>
}
asyncInsert<T>(newDoc: T) {
return justPromise.call(this, 'insert', arguments)
}
asyncUpdate(query: any, updateQuery: any, options?: Nedb.UpdateOptions) {
return justPromise.call(this, 'update', arguments)
}
asyncRemove(query: any, options?: Nedb.RemoveOptions) {
return justPromise.call(this, 'remove', arguments)
}
asyncEnsureIndex(options: Nedb.EnsureIndexOptions, ) {
return justPromise.call(this, 'ensureIndex', arguments)
}
asyncRemoveIndex(fieldName: string) {
return justPromise.call(this, 'removeIndex', arguments)
}
asyncLoadDatabase() {
return new Promise((resolve, reject) => {
this.loadDatabase((err) => {
err ? reject(err) : resolve(true)
})
});
}
}
asyncFindOne<T>(query: any, projection?: T) {
return promisefy.call(this, 'findOne', arguments) as Promise<T>
}
asyncInsert<T>(newDoc: T) {
return justPromise.call(this, 'insert', arguments)
}
asyncUpdate(query: any, updateQuery: any, options?: Nedb.UpdateOptions) {
return justPromise.call(this, 'update', arguments)
}
asyncRemove(query: any, options?: Nedb.RemoveOptions) {
return justPromise.call(this, 'remove', arguments)
}
asyncEnsureIndex(options: Nedb.EnsureIndexOptions,) {
return justPromise.call(this, 'ensureIndex', arguments)
}
asyncRemoveIndex(fieldName: string) {
return justPromise.call(this, 'removeIndex', arguments)
}
}
{
"name": "nedb-async",
"version": "0.0.8",
"version": "0.0.9",
"description": "Promise wrapper for Nedb that makes it possible to use all Nedb all cursor modifiers.",

@@ -5,0 +5,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc