# hiot-app-js

library with structure and common components for our nodejs applications

To write a middleware all you need to do is to write a function that takes a locator object
as a param and returns a promise that resolved the input param locator.

# Install

```bash
npm install hiot-app
```

# Tests

```bash
npm install
npm test
```

## Prettier & ESlint

we use `prettier` to format our code. Our recommendation is to configure your editor to autoformat during save. If you open up the VS Code User's settings/preferences as UI, search for "Format On Save" and make sure to activate it. Afterward, the file should format automatically once you save it. Now you don’t need to worry about your code formatting anymore, because Prettier takes care of it.

```
#manual checking and apply
npx prettier --check .
npx prettier --write .

#validate passes eslint
yarn run eslint .
yarn run eslint . --fix
# or
npm run lint
npm run lint-fix
```

## Publishing

```
npm install
npm test
npm login
(follow instructions)
npm publish
```
