From eef40f0c95110441a896845f8e7e67d580643bbc Mon Sep 17 00:00:00 2001 From: Adrien Castex Date: Mon, 12 Jun 2017 11:42:26 +0200 Subject: [PATCH] Added the 'autoSave' option --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 28ff2b74..a1951399 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ canChunk | `true` | Define if the server must recreate the full message or if it hostname | `'::'` | Define the scope of the listening server. port | `1900` | The default port to use if no port is specified when calling `server.start()`. strictMode | `false` | Define if the server must blindly follow the WebDAV RFC (`true`) or allow more flexibility (`false`) (for instance disallow a body in a request which doesn't use a body). +autoSave | `null` | Define an auto-saver to automatically save the state of the server and taking care of any conflict which can happen while writing the persistence file and limit the number of writes when some are not required (3 PUT in a row will lead to 2 writes, the first and last ones) (the GET request, for instance, doesn't lead to a write). The `autoSave` option is an `object` of type : `{ treeFilePath : string, tempTreeFilePath : string, onSaveError ?: (error : Error) => void, streamProvider ?: (inputStream : Writable, callback : (outputStream ?: Writable) => void) => void }`. ## Sample