From 4b7af32eb1c1c7424b08c32b9ececaf6750a80c8 Mon Sep 17 00:00:00 2001 From: Max Guglielmi Date: Sat, 13 May 2017 11:09:21 +1000 Subject: [PATCH] Updated README --- README.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bef34604..954a22ae 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ git clone https://github.com/koalyptus/TableFilter.git * You can [download](https://github.com/koalyptus/TableFilter/archive/master.zip) this repository. -* Alternatively, install TableFilter files in your npm enabled project using: +* TableFilter is available on [npm repository](https://www.npmjs.com/package/tablefilter), you can install it from the command line using the following command: ```shell npm install tablefilter --save-dev ``` @@ -40,15 +40,32 @@ npm install tablefilter --save-dev ```shell npm install tablefilter@next --save-dev ``` -* If you don't use `npm`, you can also -[access these files on unpkg](https://unpkg.com/tablefilter/), download them -or point your package manager to them. +* Alternatively you can also [access these files from unpkg CDN](https://unpkg.com/tablefilter/), download them or point your package manager to them. ## Setup +### Using modules +Require `TableFilter`: +```javascript +// ES2015 modules +import TableFilter from 'tablefilter'; + +// CommonJS or AMD modules +var TableFilter = require('tablefilter'); +``` + +### Using distribution scripts +If you are not using a module system, you can reference the distribution scripts directly in your html pages: +```html + +``` + +### Placing manually the distribution scripts in your project Copy the ``tablefilter`` directory under ``dist`` and place it at desired location in your project. Then include the main js file in your page: ```shell ``` + +### Usage Place the following snippet just under the HTML table and always define a ``base_path`` property in the configuration object to reflect the path to the script ```shell