### Base library for Javascript projects

Demo's and documentation

#### webcomponents

`@ema/js-base/dist/webcomponents.js`

- shareable webcomponents library
- for widgets / microapps / apps

#### generic javascript library

`@ema/js-base/dist/lib/index`

- javascript modules and classes library
- shareable among all Javascript projects
- config - api - util etc.

Distribution: npm / http / https

### Using the webcomponents library

#### Script tag

- Put the following script tag in the head of your index.html: `<script src='https://unpkg.com/@ema/js-base/dist/webcomponents.js'></script>`
- Then you can use the element anywhere in your template, JSX, html etc

#### Node Modules

- Run `npm install @ema/js-base --save`
- Put a script tag similar to this `<script src='node_modules/@ema/js-base/dist/webcomponents.js'></script>` in the head of your index.html
- Then you can use the webcomponents anywhere in your template, JSX, html etc

#### In a stencil-starter app

- Run `npm install @ema/js-base --save`
- Add an import to the npm packages `import @ema/js-base;`
- Then you can use the webcomponents anywhere in your template, JSX, html etc

### Using the modules library

#### Node Modules

- Run `npm install @ema/js-base --save`
- ES5 usage: `import { ConfigService, DomUtil } from '@ema/js-base/dist/lib/index'`
- ES6 usage: `import { ConfigService, DomUtil } from '@ema/js-base/dist/collection/index'`

### Dev: getting started

Clone the repo, then run:

    npm install
    npm start

To watch for file changes during develop, run:

    npm run dev

To build the components and classes for production, run:

    npm run build

To run the unit tests for the components and classes, run:

    npm test

Need help? Check out the Stencil docs here.