@stacksjs/storage 0.52.0 → 0.52.2

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.
package/dist/index.d.ts CHANGED
@@ -4,6 +4,10 @@ export declare const _dirname: any;
4
4
  * Reads a JSON file and returns the parsed data.
5
5
  */
6
6
  export declare function readJsonFile(name: string, cwd?: string): Promise<JsonFile>;
7
+ /**
8
+ * Reads a package.json file and returns the parsed data.
9
+ */
10
+ export declare function readPackageJson(name: string, cwd?: string): Promise<PackageJson>;
7
11
  /**
8
12
  * Writes the given data to the specified JSON file.
9
13
  */
package/dist/index.mjs CHANGED
@@ -11,6 +11,11 @@ export async function readJsonFile(name, cwd) {
11
11
  const newline = detectNewline(file.data);
12
12
  return { ...file, data, indent, newline };
13
13
  }
14
+ export async function readPackageJson(name, cwd) {
15
+ const file = await readJsonFile(name, cwd);
16
+ const data = file.data;
17
+ return data;
18
+ }
14
19
  export async function writeJsonFile(file) {
15
20
  let json = JSON.stringify(file.data, void 0, file.indent);
16
21
  if (file.newline)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/storage",
3
3
  "type": "module",
4
- "version": "0.52.0",
4
+ "version": "0.52.2",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "The Stacks file system.",
7
7
  "author": "Chris Breuer",
@@ -45,13 +45,13 @@
45
45
  "peerDependencies": {
46
46
  "fs-extra": "^11.1.1",
47
47
  "unstorage": "^1.6.0",
48
- "@stacksjs/arrays": "0.52.0",
49
- "@stacksjs/path": "0.52.0",
50
- "@stacksjs/types": "0.52.0",
51
- "@stacksjs/utils": "0.52.0"
48
+ "@stacksjs/arrays": "0.52.2",
49
+ "@stacksjs/path": "0.52.2",
50
+ "@stacksjs/types": "0.52.2",
51
+ "@stacksjs/utils": "0.52.2"
52
52
  },
53
53
  "devDependencies": {
54
- "@stacksjs/development": "0.52.0"
54
+ "@stacksjs/development": "0.52.2"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "unbuild",