You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The core library contains the logic for parsing, converting and unit definitions.
6
-
It was created mainly for the [UUC Frontend app](../frontend/README.md), but is also available as a standalone library at npm.
6
+
It was created mainly for the [UUC Frontend app](https://github.com/Lemonexe/UUC/blob/master/packages/frontend/README.md), but is also available as a standalone library at npm.
7
7
It is written in TypeScript, and is only distributed as ESM.
8
8
9
9
This page documents the _usage_ of the library for end users, as distributed via npm.
10
-
If you wish to take part of the library development _(or fork it)_, please see [local dev setup instructions](./CONTRIBUTING.md).
10
+
If you wish to take part of the library development _(or fork it)_, please see [local dev setup instructions](https://github.com/Lemonexe/UUC/blob/master/packages/core/CONTRIBUTING.md).
11
11
12
12
## Documentation basics
13
13
14
14
This guide assumes that you are a user of the UUC App ([live here](https://jira.zby.cz/content/UUC/)), and are familiar with its features.
15
15
If not, please go through the Tutorial there, which will demonstrate typical use cases, i.e. what a typical conversion job looks like.
16
-
For implementation details, refer to [the source code](./src), particularly the TypeScript declarations and unit tests.
16
+
For implementation details, refer to [the source code](https://github.com/Lemonexe/UUC/blob/master/packages/core/src), particularly the TypeScript declarations and unit tests.
17
17
18
18
### Installation
19
19
@@ -25,7 +25,7 @@ npm install uuc-core
25
25
### Initialization
26
26
27
27
All functions are pure and stateless, so you may import and use them right away.
28
-
Though if you wish to use currency units, initialize them first with an object of exchange rates to any base currency (see [API used by Frontend](../frontend/src/io/currencies.ts)):
28
+
Though if you wish to use currency units, initialize them first with an object of exchange rates to any base currency (see [API used by Frontend](https://github.com/Lemonexe/UUC/blob/master/packages/frontend/src/io/currencies.ts)):
29
29
```javascript
30
30
import { populateCurrencies } from'uuc-core'
31
31
populateCurrencies({ USD:1.5, EUR:1, CZK:26, BTC:21e-6 }) // any subset of available currencies may be populated, others will stay undefined
@@ -97,6 +97,6 @@ and others...
97
97
98
98
### Errors
99
99
100
-
Exceptions as well as warnings are represented by the [UUCError](./src/errors.ts).
100
+
Exceptions as well as warnings are represented by the [UUCError](https://github.com/Lemonexe/UUC/blob/master/packages/core/src/errors.ts).
101
101
Refer to its source code for all possible error/warning codes.
102
102
The main `convert` function catches errors and includes them in status and messages, but lower-level function will throw them.
0 commit comments