express-generator-typescript 2.7.11 → 2.7.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/lib/cli.js +0 -0
  4. package/lib/express-generator-typescript.js +44 -11
  5. package/lib/project-files/.prettierignore +12 -0
  6. package/lib/project-files/.prettierrc.json +15 -0
  7. package/lib/project-files/README.md +54 -65
  8. package/lib/project-files/config/.env.development +0 -0
  9. package/lib/project-files/config/.env.production +0 -0
  10. package/lib/project-files/config/.env.test +0 -0
  11. package/lib/project-files/eslint.config.ts +46 -100
  12. package/lib/project-files/gitignore +0 -2
  13. package/lib/project-files/package.json +62 -56
  14. package/lib/project-files/src/common/constants/HttpStatusCodes.ts +393 -394
  15. package/lib/project-files/src/common/constants/Paths.ts +15 -15
  16. package/lib/project-files/src/common/constants/{EnvVars.ts → env.ts} +28 -19
  17. package/lib/project-files/src/common/utils/{misc.ts → number-utils.ts} +10 -11
  18. package/lib/project-files/src/common/utils/route-errors.ts +35 -36
  19. package/lib/project-files/src/common/utils/validators.ts +14 -14
  20. package/lib/project-files/src/{index.ts → main.ts} +24 -27
  21. package/lib/project-files/src/models/User.ts +73 -72
  22. package/lib/project-files/src/models/common/IModel.ts +4 -0
  23. package/lib/project-files/src/public/stylesheets/users.css +50 -48
  24. package/lib/project-files/src/repos/MockOrm.ts +57 -63
  25. package/lib/project-files/src/repos/UserRepo.ts +131 -133
  26. package/lib/project-files/src/repos/{database.json → common/database.json} +0 -0
  27. package/lib/project-files/src/repos/common/database.test.json +1 -0
  28. package/lib/project-files/src/routes/UserRoutes.ts +77 -69
  29. package/lib/project-files/src/routes/{index.ts → apiRouter.ts} +28 -28
  30. package/lib/project-files/src/routes/common/{types.ts → express-types.ts} +9 -10
  31. package/lib/project-files/src/routes/common/{utils.ts → parseReq.ts} +19 -16
  32. package/lib/project-files/src/server.ts +79 -84
  33. package/lib/project-files/src/services/{UserService/index.ts → UserService.ts} +64 -58
  34. package/lib/project-files/src/views/users.html +118 -132
  35. package/lib/project-files/tests/common/{utils.ts → comparators.ts} +38 -55
  36. package/lib/project-files/tests/common/error-utils.ts +25 -0
  37. package/lib/project-files/tests/common/{types.ts → supertest-types.ts} +15 -16
  38. package/lib/project-files/tests/{aux/setup.ts → support/agent.ts} +23 -26
  39. package/lib/project-files/tests/users.test.ts +131 -123
  40. package/lib/project-files/tsconfig.json +29 -35
  41. package/lib/project-files/tsconfig.prod.json +27 -30
  42. package/lib/project-files/vitest.config.mts +21 -18
  43. package/package.json +1 -1
  44. package/lib/project-files/config.ts +0 -22
  45. package/lib/project-files/scripts/build.ts +0 -28
  46. package/lib/project-files/scripts/common/utils.ts +0 -93
  47. package/lib/project-files/src/common/constants/index.ts +0 -11
  48. package/lib/project-files/src/models/common/types.ts +0 -5
  49. package/lib/project-files/src/repos/database.test.json +0 -1
  50. package/lib/project-files/src/services/UserService/constants.ts +0 -5
@@ -0,0 +1,25 @@
1
+ import { isString } from 'jet-validators';
2
+ import { ParseError, parseJson } from 'jet-validators/utils';
3
+
4
+ /******************************************************************************
5
+ Types
6
+ ******************************************************************************/
7
+
8
+ interface IValidationError {
9
+ message: string;
10
+ errors: ParseError[];
11
+ }
12
+
13
+ /******************************************************************************
14
+ Functions
15
+ ******************************************************************************/
16
+
17
+ /**
18
+ * JSON parse a validation error.
19
+ */
20
+ export function parseValidationError(arg: unknown): IValidationError {
21
+ if (!isString(arg)) {
22
+ throw new Error('Not a string');
23
+ }
24
+ return parseJson<IValidationError>(arg);
25
+ }
@@ -1,16 +1,15 @@
1
- import { Response } from 'supertest';
2
-
3
-
4
- /******************************************************************************
5
- Types
6
- ******************************************************************************/
7
-
8
- // Use generics to add properties to 'body'
9
- export type TRes<T = object> = Omit<Response, 'body'> & {
10
- body: T & { error?: string | IErrorObject },
11
- };
12
-
13
- interface IErrorObject {
14
- message: string;
15
- [key: string]: unknown;
16
- }
1
+ import { Response } from 'supertest';
2
+
3
+ /******************************************************************************
4
+ Types
5
+ ******************************************************************************/
6
+
7
+ // Use generics to add properties to 'body'
8
+ export interface IRes<T = object> extends Omit<Response, 'body'> {
9
+ body: T & { error?: string | IErrorObject };
10
+ }
11
+
12
+ interface IErrorObject {
13
+ message: string;
14
+ [key: string]: unknown;
15
+ }
@@ -1,26 +1,23 @@
1
-
2
- import { beforeAll } from 'vitest';
3
- import supertest, { Test } from 'supertest';
4
- import TestAgent from 'supertest/lib/agent';
5
-
6
- import app from '@src/server';
7
- import MockOrm from '@src/repos/MockOrm';
8
-
9
-
10
- /******************************************************************************
11
- Run
12
- ******************************************************************************/
13
-
14
- let agent: TestAgent<Test>;
15
-
16
- beforeAll(async () => {
17
- agent = supertest.agent(app);
18
- await MockOrm.cleanDb();
19
- });
20
-
21
-
22
- /******************************************************************************
23
- Export
24
- ******************************************************************************/
25
-
26
- export { agent };
1
+ import supertest, { Test } from 'supertest';
2
+ import TestAgent from 'supertest/lib/agent';
3
+ import { beforeAll } from 'vitest';
4
+
5
+ import MockOrm from '@src/repos/MockOrm';
6
+ import app from '@src/server';
7
+
8
+ /******************************************************************************
9
+ Run
10
+ ******************************************************************************/
11
+
12
+ let agent: TestAgent<Test>;
13
+
14
+ beforeAll(async () => {
15
+ agent = supertest.agent(app);
16
+ await MockOrm.cleanDb();
17
+ });
18
+
19
+ /******************************************************************************
20
+ Export
21
+ ******************************************************************************/
22
+
23
+ export { agent };
@@ -1,123 +1,131 @@
1
- import UserRepo from '@src/repos/UserRepo';
2
- import User, { IUser } from '@src/models/User';
3
- import { USER_NOT_FOUND_ERROR } from '@src/services/UserService/constants';
4
-
5
- import HttpStatusCodes from '@src/common/constants/HttpStatusCodes';
6
- import { ValidationError } from '@src/common/utils/route-errors';
7
- import { JetPaths as Paths } from '@src/common/constants/Paths';
8
-
9
- import { compareUserArrays, parseValidationError } from './common/utils';
10
- import { agent } from './aux/setup';
11
- import { TRes } from './common/types';
12
-
13
- /******************************************************************************
14
- Constants
15
- ******************************************************************************/
16
-
17
- const DUMMY_USERS = [
18
- User.new({ name: 'Sean Maxwell', email: 'sean.maxwell@gmail.com' }),
19
- User.new({ name: 'John Smith', email: 'john.smith@gmail.com' }),
20
- User.new({ name: 'Gordan Freeman', email: 'gordan.freeman@gmail.com' }),
21
- ] as const;
22
-
23
- const {
24
- BAD_REQUEST,
25
- CREATED,
26
- OK,
27
- NOT_FOUND,
28
- } = HttpStatusCodes;
29
-
30
- /******************************************************************************
31
- Tests
32
- IMPORTANT: Following TypeScript best practices, we test all scenarios that
33
- can be triggered by a user under normal circumstances. Not all theoretically
34
- scenarios (i.e. a failed database connection).
35
- ******************************************************************************/
36
-
37
- describe('UserRouter', () => {
38
-
39
- let dbUsers: IUser[] = [];
40
-
41
- beforeEach(async () => {
42
- await UserRepo.deleteAllUsers();
43
- dbUsers = await UserRepo.insertMultiple(DUMMY_USERS);
44
- });
45
-
46
- describe(`"GET:${Paths.Users.Get}"`, () => {
47
-
48
- it('should return a JSON object with all the users and a status code of ' +
49
- `"${OK}" if the request was successful.`, async () => {
50
- const res: TRes<{ users: IUser[]}> = await agent.get(Paths.Users.Get);
51
- expect(res.status).toBe(OK);
52
- expect(compareUserArrays(res.body.users, DUMMY_USERS)).toBeTruthy();
53
- });
54
- });
55
-
56
- describe(`"POST:${Paths.Users.Add}"`, () => {
57
-
58
- it(`should return a status code of "${CREATED}" if the request was ` +
59
- 'successful.', async () => {
60
- const user = User.new({ name: 'a', email: 'a@a.com' }),
61
- res = await agent.post(Paths.Users.Add).send({ user });
62
- expect(res.status).toBe(CREATED);
63
- });
64
-
65
- it('should return a JSON object with an error message of and a status ' +
66
- `code of "${BAD_REQUEST}" if the user param was missing.`, async () => {
67
- const res: TRes = await agent.post(Paths.Users.Add).send({ user: null });
68
- expect(res.status).toBe(BAD_REQUEST);
69
- const errorObject = parseValidationError(res.body.error);
70
- expect(errorObject.message).toBe(ValidationError.MESSAGE);
71
- expect(errorObject.errors[0].key).toStrictEqual('user');
72
- });
73
- });
74
-
75
- describe(`"PUT:${Paths.Users.Update}"`, () => {
76
-
77
- it(`should return a status code of "${OK}" if the request was successfull`,
78
- async () => {
79
- const user = DUMMY_USERS[0];
80
- user.name = 'Bill';
81
- const res = await agent.put(Paths.Users.Update).send({ user });
82
- expect(res.status).toBe(OK);
83
- });
84
-
85
- it('should return a JSON object with an error message and a status code ' +
86
- `of "${BAD_REQUEST}" if id is the wrong data type`, async () => {
87
- const user = User.new();
88
- user.id = ('5' as unknown as number);
89
- const res: TRes = await agent.put(Paths.Users.Update).send({ user });
90
- expect(res.status).toBe(BAD_REQUEST);
91
- const errorObj = parseValidationError(res.body.error);
92
- expect(errorObj.message).toBe(ValidationError.MESSAGE);
93
- expect(errorObj.errors[0].keyPath).toStrictEqual(['user', 'id']);
94
- });
95
-
96
- it('should return a JSON object with the error message of ' +
97
- `"${USER_NOT_FOUND_ERROR}" and a status code of "${NOT_FOUND}" if the ` +
98
- 'id was not found.', async () => {
99
- const user = User.new({ id: 4, name: 'a', email: 'a@a.com' }),
100
- res: TRes = await agent.put(Paths.Users.Update).send({ user });
101
- expect(res.status).toBe(NOT_FOUND);
102
- expect(res.body.error).toBe(USER_NOT_FOUND_ERROR);
103
- });
104
- });
105
-
106
- describe(`"DELETE:${Paths.Users.Delete()}"`, () => {
107
-
108
- it(`should return a status code of "${OK}" if the request was successful.`,
109
- async () => {
110
- const id = dbUsers[0].id,
111
- res = await agent.delete(Paths.Users.Delete(id));
112
- expect(res.status).toBe(OK);
113
- });
114
-
115
- it('should return a JSON object with the error message of ' +
116
- `"${USER_NOT_FOUND_ERROR}" and a status code of "${NOT_FOUND}" if the ` +
117
- 'id was not found.', async () => {
118
- const res: TRes = await agent.delete(Paths.Users.Delete(-1));
119
- expect(res.status).toBe(NOT_FOUND);
120
- expect(res.body.error).toBe(USER_NOT_FOUND_ERROR);
121
- });
122
- });
123
- });
1
+ import HttpStatusCodes from '@src/common/constants/HttpStatusCodes';
2
+ import { JetPaths as Paths } from '@src/common/constants/Paths';
3
+ import { ValidationError } from '@src/common/utils/route-errors';
4
+ import User, { IUser } from '@src/models/User';
5
+ import UserRepo from '@src/repos/UserRepo';
6
+
7
+ import { agent } from './support/agent';
8
+ import { IRes } from './common/supertest-types';
9
+ import { parseValidationError } from './common/error-utils';
10
+ import UserService from '@src/services/UserService';
11
+ import { compareUserArrays } from './common/comparators';
12
+
13
+ /******************************************************************************
14
+ Constants
15
+ ******************************************************************************/
16
+
17
+ const DUMMY_USERS = [
18
+ User.new({ name: 'Sean Maxwell', email: 'sean.maxwell@gmail.com' }),
19
+ User.new({ name: 'John Smith', email: 'john.smith@gmail.com' }),
20
+ User.new({ name: 'Gordan Freeman', email: 'gordan.freeman@gmail.com' }),
21
+ ] as const;
22
+
23
+ const { BAD_REQUEST, CREATED, OK, NOT_FOUND } = HttpStatusCodes;
24
+
25
+ /******************************************************************************
26
+ Tests
27
+ IMPORTANT: Following TypeScript best practices, we test all scenarios that
28
+ can be triggered by a user under normal circumstances. Not all theoretically
29
+ scenarios (i.e. a failed database connection).
30
+ ******************************************************************************/
31
+
32
+ describe('UserRouter', () => {
33
+ let dbUsers: IUser[] = [];
34
+
35
+ beforeEach(async () => {
36
+ await UserRepo.deleteAllUsers();
37
+ dbUsers = await UserRepo.insertMultiple(DUMMY_USERS);
38
+ });
39
+
40
+ describe(`"GET:${Paths.Users.Get}"`, () => {
41
+ it(
42
+ 'should return a JSON object with all the users and a status code of ' +
43
+ `"${OK}" if the request was successful.`,
44
+ async () => {
45
+ const res: IRes<{ users: IUser[] }> = await agent.get(Paths.Users.Get);
46
+ expect(res.status).toBe(OK);
47
+ expect(compareUserArrays(res.body.users, DUMMY_USERS)).toBeTruthy();
48
+ },
49
+ );
50
+ });
51
+
52
+ describe(`"POST:${Paths.Users.Add}"`, () => {
53
+ it(
54
+ `should return a status code of "${CREATED}" if the request was ` +
55
+ 'successful.',
56
+ async () => {
57
+ const user = User.new({ name: 'a', email: 'a@a.com' }),
58
+ res = await agent.post(Paths.Users.Add).send({ user });
59
+ expect(res.status).toBe(CREATED);
60
+ },
61
+ );
62
+
63
+ it(
64
+ 'should return a JSON object with an error message of and a status ' +
65
+ `code of "${BAD_REQUEST}" if the user param was missing.`,
66
+ async () => {
67
+ const res: IRes = await agent
68
+ .post(Paths.Users.Add)
69
+ .send({ user: null });
70
+ expect(res.status).toBe(BAD_REQUEST);
71
+ const errorObject = parseValidationError(res.body.error);
72
+ expect(errorObject.message).toBe(ValidationError.MESSAGE);
73
+ expect(errorObject.errors[0].key).toStrictEqual('user');
74
+ },
75
+ );
76
+ });
77
+
78
+ describe(`"PUT:${Paths.Users.Update}"`, () => {
79
+ it(`should return a status code of "${OK}" if the request was successfull`, async () => {
80
+ const user = DUMMY_USERS[0];
81
+ user.name = 'Bill';
82
+ const res = await agent.put(Paths.Users.Update).send({ user });
83
+ expect(res.status).toBe(OK);
84
+ });
85
+
86
+ it(
87
+ 'should return a JSON object with an error message and a status code ' +
88
+ `of "${BAD_REQUEST}" if id is the wrong data type`,
89
+ async () => {
90
+ const user = User.new();
91
+ user.id = '5' as unknown as number;
92
+ const res: IRes = await agent.put(Paths.Users.Update).send({ user });
93
+ expect(res.status).toBe(BAD_REQUEST);
94
+ const errorObj = parseValidationError(res.body.error);
95
+ expect(errorObj.message).toBe(ValidationError.MESSAGE);
96
+ expect(errorObj.errors[0].keyPath).toStrictEqual(['user', 'id']);
97
+ },
98
+ );
99
+
100
+ it(
101
+ 'should return a JSON object with the error message of ' +
102
+ `"${UserService.Errors.USER_NOT_FOUND}" and a status code of ` +
103
+ `"${NOT_FOUND}" if the id was not found.`,
104
+ async () => {
105
+ const user = User.new({ id: 4, name: 'a', email: 'a@a.com' }),
106
+ res: IRes = await agent.put(Paths.Users.Update).send({ user });
107
+ expect(res.status).toBe(NOT_FOUND);
108
+ expect(res.body.error).toBe(UserService.Errors.USER_NOT_FOUND);
109
+ },
110
+ );
111
+ });
112
+
113
+ describe(`"DELETE:${Paths.Users.Delete()}"`, () => {
114
+ it(`should return a status code of "${OK}" if the request was successful.`, async () => {
115
+ const id = dbUsers[0].id,
116
+ res = await agent.delete(Paths.Users.Delete(id));
117
+ expect(res.status).toBe(OK);
118
+ });
119
+
120
+ it(
121
+ 'should return a JSON object with the error message of ' +
122
+ `"${UserService.Errors.USER_NOT_FOUND}" and a status code of ` +
123
+ '"${NOT_FOUND}" if the id was not found.',
124
+ async () => {
125
+ const res: IRes = await agent.delete(Paths.Users.Delete(-1));
126
+ expect(res.status).toBe(NOT_FOUND);
127
+ expect(res.body.error).toBe(UserService.Errors.USER_NOT_FOUND);
128
+ },
129
+ );
130
+ });
131
+ });
@@ -1,35 +1,29 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "CommonJS",
5
- "lib": ["ES2020"],
6
- "strict": true,
7
- "baseUrl": "./",
8
- "esModuleInterop": true,
9
- "skipLibCheck": true,
10
- "forceConsistentCasingInFileNames": true,
11
- "paths": {
12
- "@src/*": ["src/*"]
13
- },
14
- "useUnknownInCatchVariables": false,
15
- "types": ["vitest/globals"],
16
- },
17
- "ts-node": {
18
- "swc": true,
19
- "require": [
20
- "tsconfig-paths/register",
21
- "./config.ts"
22
- ],
23
- },
24
- "include": [
25
- "src/**/*.ts",
26
- "tests/**/*.ts",
27
- "config.ts",
28
- "scripts",
29
- "eslint.config.ts",
30
- "vitest.config.mts"
31
- ],
32
- "exclude": [
33
- "src/public/*"
34
- ]
35
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "commonjs",
5
+ "lib": ["ES2020"],
6
+ "strict": true,
7
+ "baseUrl": "./",
8
+ "esModuleInterop": true,
9
+ "skipLibCheck": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "paths": {
12
+ "@src/*": ["src/*"]
13
+ },
14
+ "useUnknownInCatchVariables": false,
15
+ "types": ["vitest/globals"]
16
+ },
17
+ "ts-node": {
18
+ "swc": true,
19
+ "require": ["tsconfig-paths/register", "dotenv/config"],
20
+ },
21
+ "include": [
22
+ "src/**/*.ts",
23
+ "tests/**/*.ts",
24
+ "scripts",
25
+ "eslint.config.ts",
26
+ "vitest.config.mts"
27
+ ],
28
+ "exclude": ["src/public/*"]
29
+ }
@@ -1,30 +1,27 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "CommonJS",
5
- "lib": ["ES2020"],
6
- "strict": true,
7
- "baseUrl": "./",
8
- "outDir": "temp",
9
- "esModuleInterop": true,
10
- "skipLibCheck": true,
11
- "forceConsistentCasingInFileNames": true,
12
- "paths": {
13
- "@src/*": ["src/*"]
14
- },
15
- "useUnknownInCatchVariables": false,
16
- "sourceMap": false,
17
- "removeComments": true
18
- },
19
- "include": [
20
- "src/**/*.ts",
21
- "config.ts"
22
- ],
23
- "exclude": [
24
- "tests",
25
- "src/public/",
26
- "scripts",
27
- "eslint.config.ts",
28
- "vitest.config.js"
29
- ]
30
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "CommonJS",
5
+ "lib": ["ES2020"],
6
+ "strict": true,
7
+ "baseUrl": "./",
8
+ "outDir": "dist",
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "paths": {
13
+ "@src/*": ["src/*"]
14
+ },
15
+ "useUnknownInCatchVariables": false,
16
+ "sourceMap": false,
17
+ "removeComments": true
18
+ },
19
+ "include": ["src/**/*.ts"],
20
+ "exclude": [
21
+ "tests",
22
+ "src/public/",
23
+ "scripts",
24
+ "eslint.config.ts",
25
+ "vitest.config.js"
26
+ ]
27
+ }
@@ -1,18 +1,21 @@
1
- import { defineConfig } from 'vitest/config';
2
- import path from 'path';
3
-
4
- const config = defineConfig({
5
- test: {
6
- globals: true,
7
- environment: 'node',
8
- setupFiles: ['config.ts', './tests/aux/setup.ts'],
9
- isolate: true,
10
- },
11
- resolve: {
12
- alias: {
13
- '@src': path.resolve(__dirname, './src'),
14
- },
15
- },
16
- });
17
-
18
- export default config;
1
+ import path from 'path';
2
+ import { defineConfig } from 'vitest/config';
3
+
4
+ const config = defineConfig({
5
+ test: {
6
+ globals: true,
7
+ environment: 'node',
8
+ setupFiles: ['dotenv/config', './tests/support/agent.ts'],
9
+ isolate: true,
10
+ env: {
11
+ DOTENV_CONFIG_PATH: 'config/.env.test',
12
+ },
13
+ },
14
+ resolve: {
15
+ alias: {
16
+ '@src': path.resolve(__dirname, './src'),
17
+ },
18
+ },
19
+ });
20
+
21
+ export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-generator-typescript",
3
- "version": "2.7.11",
3
+ "version": "2.7.14",
4
4
  "description": "Generate new Express applications similar to express-generate which but sets it up to use TypeScript instead",
5
5
  "scripts": {
6
6
  "express-generator-typescript": "node bin/cli.js",
@@ -1,22 +0,0 @@
1
- /* eslint-disable n/no-process-env */
2
-
3
- import path from 'path';
4
- import dotenv from 'dotenv';
5
- import moduleAlias from 'module-alias';
6
-
7
-
8
- // Check the env
9
- const NODE_ENV = (process.env.NODE_ENV ?? 'development');
10
-
11
- // Configure "dotenv"
12
- const result2 = dotenv.config({
13
- path: path.join(__dirname, `./config/.env.${NODE_ENV}`),
14
- });
15
- if (result2.error) {
16
- throw result2.error;
17
- }
18
-
19
- // Configure moduleAlias
20
- if (__filename.endsWith('js')) {
21
- moduleAlias.addAlias('@src', __dirname + '/dist');
22
- }
@@ -1,28 +0,0 @@
1
- import logger from 'jet-logger';
2
- import { copy, copyFilesRec, exec, remove } from './common/utils';
3
-
4
- /******************************************************************************
5
- Run
6
- ******************************************************************************/
7
-
8
- /**
9
- * Start
10
- */
11
- (async () => {
12
- try {
13
- // Remove current build
14
- await remove('./dist/');
15
- await exec('npm run lint', '../');
16
- await exec('tsc --project tsconfig.prod.json', '../');
17
- // Copy
18
- await copyFilesRec('./src', './dist', ['.ts']);
19
- await copy('./temp/config.js', './config.js');
20
- await copy('./temp/src', './dist');
21
- await remove('./temp/');
22
- } catch (err) {
23
- logger.err(err);
24
- // eslint-disable-next-line n/no-process-exit
25
- process.exit(1);
26
- }
27
- })();
28
-