@jayfong/x-utils 1.0.0-202407012223 → 1.0.0-202407020937

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 (3) hide show
  1. package/_cjs/env.js +3 -4
  2. package/env.js +3 -3
  3. package/package.json +1 -1
package/_cjs/env.js CHANGED
@@ -36,18 +36,17 @@ var import_vtils = require("vtils");
36
36
  var import_fs = require("./fs.js");
37
37
  var import_path = require("./path.js");
38
38
  var import_yaml = require("./yaml.js");
39
- const import_meta = {};
40
39
  class XEnv {
41
40
  static getEnvVarsFromFile = (0, import_vtils.memoize)(async () => {
42
- const envYmlFile = import_path.XPath.join(import_meta.dirname, ".env.yml");
41
+ const envYmlFile = import_path.XPath.join(process.cwd(), ".env.yml");
43
42
  if (await import_fs.XFs.pathExists(envYmlFile)) {
44
43
  return import_yaml.XYaml.read(envYmlFile);
45
44
  }
46
- const envYamlFile = import_path.XPath.join(import_meta.dirname, ".env.yaml");
45
+ const envYamlFile = import_path.XPath.join(process.cwd(), ".env.yaml");
47
46
  if (await import_fs.XFs.pathExists(envYamlFile)) {
48
47
  return import_yaml.XYaml.read(envYamlFile);
49
48
  }
50
- const dotenvFile = import_path.XPath.join(import_meta.dirname, ".env");
49
+ const dotenvFile = import_path.XPath.join(process.cwd(), ".env");
51
50
  if (await import_fs.XFs.pathExists(dotenvFile)) {
52
51
  const dotenvContent = await import_fs.XFs.readFile(dotenvFile, "utf-8");
53
52
  return import_dotenv.default.parse(dotenvContent);
package/env.js CHANGED
@@ -5,15 +5,15 @@ import { XPath } from "./path.js";
5
5
  import { XYaml } from "./yaml.js";
6
6
  class XEnv {
7
7
  static getEnvVarsFromFile = memoize(async () => {
8
- const envYmlFile = XPath.join(import.meta.dirname, ".env.yml");
8
+ const envYmlFile = XPath.join(process.cwd(), ".env.yml");
9
9
  if (await XFs.pathExists(envYmlFile)) {
10
10
  return XYaml.read(envYmlFile);
11
11
  }
12
- const envYamlFile = XPath.join(import.meta.dirname, ".env.yaml");
12
+ const envYamlFile = XPath.join(process.cwd(), ".env.yaml");
13
13
  if (await XFs.pathExists(envYamlFile)) {
14
14
  return XYaml.read(envYamlFile);
15
15
  }
16
- const dotenvFile = XPath.join(import.meta.dirname, ".env");
16
+ const dotenvFile = XPath.join(process.cwd(), ".env");
17
17
  if (await XFs.pathExists(dotenvFile)) {
18
18
  const dotenvContent = await XFs.readFile(dotenvFile, "utf-8");
19
19
  return dotenv.parse(dotenvContent);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jayfong/x-utils",
3
3
  "description": "123456",
4
- "version": "1.0.0-202407012223",
4
+ "version": "1.0.0-202407020937",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "vtils": "^4.115.0",