mikroserve 0.0.1 → 0.0.4

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.
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/utils/configDefaults.ts
21
+ var configDefaults_exports = {};
22
+ __export(configDefaults_exports, {
23
+ configDefaults: () => configDefaults,
24
+ getDefaultConfig: () => getDefaultConfig
25
+ });
26
+ module.exports = __toCommonJS(configDefaults_exports);
27
+
28
+ // src/utils/getTruthyEnvValue.ts
29
+ function getTruthyEnvValue(value) {
30
+ if (value === "true" || value === true) return true;
31
+ return false;
32
+ }
33
+
34
+ // src/utils/configDefaults.ts
35
+ var configDefaults = () => {
36
+ return {
37
+ port: Number(process.env.PORT) || 3e3,
38
+ host: process.env.HOST || "0.0.0.0",
39
+ useHttps: false,
40
+ sslCert: "",
41
+ sslKey: "",
42
+ sslCa: "",
43
+ debug: getTruthyEnvValue(process.env.DEBUG) || false,
44
+ rateLimit: {
45
+ enabled: true,
46
+ requestsPerMinute: 100
47
+ },
48
+ allowedDomains: ["*"]
49
+ };
50
+ };
51
+ var getDefaultConfig = () => {
52
+ const defaults = configDefaults();
53
+ return {
54
+ port: defaults.port,
55
+ host: defaults.host,
56
+ useHttps: defaults.useHttps,
57
+ sslCert: defaults.sslCert,
58
+ sslKey: defaults.sslKey,
59
+ sslCa: defaults.sslCa,
60
+ debug: defaults.debug,
61
+ rateLimit: {
62
+ enabled: defaults.rateLimit.enabled,
63
+ requestsPerMinute: defaults.rateLimit.requestsPerMinute
64
+ },
65
+ allowedDomains: defaults.allowedDomains
66
+ };
67
+ };
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ configDefaults,
71
+ getDefaultConfig
72
+ });
@@ -0,0 +1,9 @@
1
+ import {
2
+ configDefaults,
3
+ getDefaultConfig
4
+ } from "../chunk-RP67R3W4.mjs";
5
+ import "../chunk-CQPU7577.mjs";
6
+ export {
7
+ configDefaults,
8
+ getDefaultConfig
9
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @description TODO
3
+ */
4
+ declare function getTruthyEnvValue(value: string | boolean | undefined): boolean;
5
+
6
+ export { getTruthyEnvValue };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @description TODO
3
+ */
4
+ declare function getTruthyEnvValue(value: string | boolean | undefined): boolean;
5
+
6
+ export { getTruthyEnvValue };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/utils/getTruthyEnvValue.ts
21
+ var getTruthyEnvValue_exports = {};
22
+ __export(getTruthyEnvValue_exports, {
23
+ getTruthyEnvValue: () => getTruthyEnvValue
24
+ });
25
+ module.exports = __toCommonJS(getTruthyEnvValue_exports);
26
+ function getTruthyEnvValue(value) {
27
+ if (value === "true" || value === true) return true;
28
+ return false;
29
+ }
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ getTruthyEnvValue
33
+ });
@@ -0,0 +1,6 @@
1
+ import {
2
+ getTruthyEnvValue
3
+ } from "../chunk-CQPU7577.mjs";
4
+ export {
5
+ getTruthyEnvValue
6
+ };
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "mikroserve",
3
- "description": "TODO",
4
- "version": "0.0.1",
3
+ "description": "Minimalistic, ready-to-use API, built on Node.js primitives.",
4
+ "version": "0.0.4",
5
5
  "author": "Mikael Vesavuori",
6
6
  "license": "MIT",
7
7
  "keywords": [],
8
8
  "main": "lib/index.js",
9
- "module": "lib/index.mjs",
10
9
  "repository": {
11
10
  "type": "git",
12
11
  "url": "git+https://github.com/mikaelvesavuori/mikroserve"
@@ -54,5 +53,8 @@
54
53
  "type-coverage": "2",
55
54
  "typescript": "5",
56
55
  "vitest": "2"
56
+ },
57
+ "dependencies": {
58
+ "mikroconf": "^0.0.2"
57
59
  }
58
60
  }