From ac532fb6e791151a8d63031024e1dfb0bd50fb1c Mon Sep 17 00:00:00 2001 From: Thomas Wilkerling Date: Fri, 21 May 2021 07:24:53 +0200 Subject: [PATCH] update readme --- doc/0.7.0.md | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/0.7.0.md b/doc/0.7.0.md index 5b977ab..4bdf827 100644 --- a/doc/0.7.0.md +++ b/doc/0.7.0.md @@ -21,16 +21,18 @@ You can use an instance of Index directly (very much like the old FlexSearch whe ### Basic Usage -Load the library via the ES6 module system: +#### ES6 Modules: ```js import Index from "./index.js"; import Document from "./document.js"; -var index = new Index(options); -var document = new Document(options); +const index = new Index(options); +const document = new Document(options); ``` +#### Browser Bundle (ES5 Support): + Or load one of the builds from the folder `dist` to your html as a script and use as follows: ```js @@ -38,6 +40,20 @@ var index = new FlexSearch.Index(options); var document = new FlexSearch.Document(options); ``` +#### Node.js: + +Install the non-published beta version: + +```cmd +npm install https://github.com/nextapps-de/flexsearch/tarball/0.7.0 +``` + +Use as a npm module: + +```js +const { Index, Document } = require("flexsearch"); +``` + The method signature stays almost unchanged: ```js