Update README

This commit is contained in:
2025-09-12 08:27:41 +02:00
parent f3b6393fb5
commit ca346e34ab
+10 -7
View File
@@ -1,8 +1,11 @@
# Library template
Basic template to create a TypeScript library that works properly when included
# Config
Describe the configuration you expect and let this lib parse it from env variables or files.
## How to split in multiple file
Technically, there is nothing to do, but if you want to allow sub-imports, you have to :
1. In `package.json`, under `exports`, add `"./submodule": "./src/submodule.ts"`
2. In `tsconfig.json`, under `paths`, add `"lib-name/*": ["./src/*"]`
## File parsing
1. Add `__FILE` (note the **2** `_`) at the end of any variable name
2. Set a path to a file as a value
3. The parser will
1. Read the path
2. Read the file
3. Trim any leading or trailing whitespace
4. Use the value for the config