From 03cef583fdf8a6cdedd3058d3233952a6f2c05bf Mon Sep 17 00:00:00 2001 From: Louis Chatriot Date: Wed, 31 Dec 2014 14:22:23 +0100 Subject: [PATCH] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bb8c48a..1c59070 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,8 @@ need to call `loadDatabase`). Any command issued before load is finished is buffered and will be executed when load is done. * `onload` (optional): if you use autoloading, this is the handler called after the `loadDatabase`. It takes one `error` argument. If you use autoloading without specifying this handler, and an error happens during load, an error will be thrown. +* `afterSerialization` (optional): hook you can use to transform data after it was serialized and before it is written to disk. Can be used for example to encrypt data before writing database to disk. This function takes a string as parameter (one line of an NeDB data file) and outputs the transformed string, which must absolutely not contain a `\\n` character (or data will be lost) +* `beforeDeserialization` (optional): reverse of `afterSerialization`. Warning, make sure to include both and not just one or you risk data loss. For the same reason, make sure both functions are inverses of one another * `nodeWebkitAppName` (optional, **DEPRECATED**): if you are using NeDB from whithin a Node Webkit app, specify its name (the same one you use in the `package.json`) in this field and the `filename` will be relative to the directory Node Webkit uses to store the rest of the application's data (local storage etc.). It works on Linux, OS X and Windows. Now that you can use `require('nw.gui').App.dataPath` in Node Webkit to get the path to the data directory for your application, you should not use this option anymore and it will be removed. If you use a persistent datastore without the `autoload` option, you need to call `loadDatabase` manually.