@@ -16,13 +16,14 @@ Check the [demo](https://mindsers.github.io/nativetable/) page.
1616
1717### Package manager installation
1818
19- Nativetable is available as a client side npm dependency. To install Nativetable with npm :
19+ Nativetable is available as a client side npm dependency. To install Nativetable with npm or yarn :
2020
21- ``` bash
21+ ``` sh
2222npm install nativetable --save
23+ yarn add nativetable
2324```
2425
25- Nativetable library is ready to be import on your project : ` ./node_modules/nativetable/dist/nativetable.min.js `
26+ Nativetable library is ready. Build file is available at this path : ` ./node_modules/nativetable/dist/nativetable.min.js `
2627
2728### Manual installation
2829You can build your own Nativetable with this project.
@@ -39,15 +40,40 @@ npm install
3940npm run build
4041```
4142
42- Nativetable library is ready to be import on your project : ` ./dist/nativetable.min.js `
43+ Nativetable library is ready to be import on your project: ` ./dist/nativetable.min.js `
4344
4445## Usage
4546
47+ - If your are using tools for importing / bundling dependencies (umd format) for you, you can import Nativetable this way:
48+
49+ ``` js
50+ const Nativetable = require (' nativetable' ).Nativetable // classic
51+
52+ const { Nativetable } = require (' nativetable' ) // es6 destructuring
53+
54+ import { Nativetable } from ' nativetable' // es6 import
55+
56+ // ...
57+
58+ const nt = new Nativetable (' tableid' )
59+ ```
60+
61+ - If you decide to import Nativetable with simple ` <script/> ` tag, all Nativetable classes is available in ` nativetable ` umd module.
62+
4663Add a script tag on your page to call Nativatable.
4764``` html
4865<script src =" nativetable.min.js" ></script >
4966```
5067
68+ And in ` *.js|ts ` file:
69+ ``` js
70+ const Nativetable = nativetable .Nativetable // get Nativetable class from nativetable module
71+
72+ // ...
73+
74+ const nt = new Nativetable (' tableid' )
75+ ```
76+
5177### Sample code
5278
5379``` js
0 commit comments