@@ -93,17 +93,17 @@ Let's create two files. Both exporting a constant and calling `mainFn`:
9393
9494` ` ` js
9595// src/a.js
96- import { mainFn } from " @compas/stdlib " ;
96+ import { a } from " ./a.js " ;
9797import { b } from " ./b.js" ;
98+ import { mainFn } from " @compas/stdlib" ;
99+
100+ // src/b.js
101+ import { mainFn } from " @compas/stdlib" ;
98102
99103mainFn (import .meta , (logger ) => logger .info ({ message : "Hello from a .js ", b }));
100104
101105export const a = true ;
102106
103- // src/b.js
104- import { mainFn } from " @compas/stdlib" ;
105- import { a } from " ./a.js" ;
106-
107107mainFn (import .meta , (logger ) => logger .info ({ message : "Hello from b .js .", a }));
108108
109109export const b = false ;
@@ -136,14 +136,13 @@ called when you start your program with `node ./src/b.js`.
136136
137137## Environment
138138
139- The ` mainFn` function from ` @compas/ stdlib` , and by extension ` mainTestFn` and
140- ` mainBenchFn` , automatically loads the ` .env .local ` and ` .env ` files in the root of the
141- project. The idea is that the ` .env ` contains default values for a quick development
142- setup, so a new person on the team can just clone the project and run it directly. The
143- ` .env .local ` values take precedence over values defined the ` .env ` file, and should be
144- ` .gitingore ` 'd. This is useful when your particular dev setup is somehow different, ie
145- your not using the ` compas docker` based Postgres instance, but need to connect to a
146- different Postgres instance.
139+ The ` mainFn` function from ` @compas/ stdlib` , and by extension ` mainTestFn` , automatically
140+ loads the ` .env .local ` and ` .env ` files in the root of the project. The idea is that the
141+ ` .env ` contains default values for a quick development setup, so a new person on the team
142+ can just clone the project and run it directly. The ` .env .local ` values take precedence
143+ over values defined the ` .env ` file, and should be ` .gitingore ` 'd. This is useful when
144+ your particular dev setup is somehow different, ie your not using the ` compas docker`
145+ based Postgres instance, but need to connect to a different Postgres instance.
147146
148147It is expected that production values for these environment variables are injected by the
149148hosting method of choice.
0 commit comments