@stryke/fs 0.10.4 → 0.10.6

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/README.md CHANGED
@@ -22,7 +22,7 @@ This package is part of Storm Software's **đŸŒŠī¸ Stryke** monorepo. Stryke pac
22
22
 
23
23
  <h3 align="center">đŸ’ģ Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
24
24
 
25
- [![Version](https://img.shields.io/badge/version-0.10.2-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/stryke/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
+ [![Version](https://img.shields.io/badge/version-0.10.4-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/stryke/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
26
26
 
27
27
  > [!IMPORTANT] This repository, and the apps, libraries, and tools contained
28
28
  > within, is still in it's initial development phase. As a result, bugs and
@@ -13,16 +13,16 @@ var _filePathFns = require("@stryke/path/file-path-fns");
13
13
  var _nodeFs = require("node:fs");
14
14
  var _promises = require("node:fs/promises");
15
15
  var _helpers = require("./helpers.cjs");
16
- const writeFileSync = (r, o, t) => {
16
+ const writeFileSync = (r, o, t = {}) => {
17
17
  if (!r) throw new Error("No file path provided to write data");
18
18
  const e = (0, _filePathFns.findFilePath)((0, _correctPath.correctPath)(r));
19
- if (!(0, _exists.existsSync)(e)) if (t?.createDirectory !== !1) (0, _helpers.createDirectorySync)(e);else throw new Error(`Directory ${e} does not exist`);
19
+ if (!(0, _exists.existsSync)(e)) if (t.createDirectory !== !1) (0, _helpers.createDirectorySync)(e);else throw new Error(`Directory ${e} does not exist`);
20
20
  (0, _nodeFs.writeFileSync)(r, o || "", t);
21
21
  },
22
- writeFile = async (r, o, t) => {
22
+ writeFile = async (r, o, t = {}) => {
23
23
  if (!r) throw new Error("No file path provided to read data");
24
24
  const e = (0, _filePathFns.findFilePath)((0, _correctPath.correctPath)(r));
25
- if (!(0, _exists.existsSync)(e)) if (t?.createDirectory !== !1) await (0, _helpers.createDirectory)(e);else throw new Error(`Directory ${e} does not exist`);
25
+ if (!(0, _exists.existsSync)(e)) if (t.createDirectory !== !1) await (0, _helpers.createDirectory)(e);else throw new Error(`Directory ${e} does not exist`);
26
26
  return (0, _promises.writeFile)(r, o || "", t);
27
27
  };
28
28
  exports.writeFile = writeFile;
@@ -1,3 +1,3 @@
1
- import{StormJSON as i}from"@stryke/json/storm-json";import{correctPath as n}from"@stryke/path/correct-path";import{existsSync as s}from"@stryke/path/exists";import{findFilePath as c}from"@stryke/path/file-path-fns";import{writeFileSync as p}from"node:fs";import{writeFile as d}from"node:fs/promises";import{createDirectory as a,createDirectorySync as f}from"./helpers";export const writeFileSync=(r,o,t)=>{if(!r)throw new Error("No file path provided to write data");const e=c(n(r));if(!s(e))if(t?.createDirectory!==!1)f(e);else throw new Error(`Directory ${e} does not exist`);p(r,o||"",t)},writeFile=async(r,o,t)=>{if(!r)throw new Error("No file path provided to read data");const e=c(n(r));if(!s(e))if(t?.createDirectory!==!1)await a(e);else throw new Error(`Directory ${e} does not exist`);return d(r,o||"",t)};export function writeJsonFileSync(r,o,t){const e=i.stringify(o,t);return writeFileSync(r,t?.appendNewLine?`${e}
1
+ import{StormJSON as i}from"@stryke/json/storm-json";import{correctPath as n}from"@stryke/path/correct-path";import{existsSync as s}from"@stryke/path/exists";import{findFilePath as c}from"@stryke/path/file-path-fns";import{writeFileSync as p}from"node:fs";import{writeFile as d}from"node:fs/promises";import{createDirectory as a,createDirectorySync as f}from"./helpers";export const writeFileSync=(r,o,t={})=>{if(!r)throw new Error("No file path provided to write data");const e=c(n(r));if(!s(e))if(t.createDirectory!==!1)f(e);else throw new Error(`Directory ${e} does not exist`);p(r,o||"",t)},writeFile=async(r,o,t={})=>{if(!r)throw new Error("No file path provided to read data");const e=c(n(r));if(!s(e))if(t.createDirectory!==!1)await a(e);else throw new Error(`Directory ${e} does not exist`);return d(r,o||"",t)};export function writeJsonFileSync(r,o,t){const e=i.stringify(o,t);return writeFileSync(r,t?.appendNewLine?`${e}
2
2
  `:e)}export async function writeJsonFile(r,o,t){const e=i.stringify(o);return writeFile(r,t?.appendNewLine?`${e}
3
3
  `:e)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/fs",
3
- "version": "0.10.4",
3
+ "version": "0.10.6",
4
4
  "type": "module",
5
5
  "description": "A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.",
6
6
  "repository": {
@@ -18,10 +18,10 @@
18
18
  "nanotar": "^0.2.0",
19
19
  "picomatch": "^4.0.2",
20
20
  "semver": "7.7.1",
21
- "@stryke/json": ">=0.5.3",
22
- "@stryke/path": ">=0.4.6",
23
- "@stryke/type-checks": ">=0.1.3",
24
- "@stryke/types": ">=0.7.2"
21
+ "@stryke/json": "^0.5.4",
22
+ "@stryke/path": "^0.4.7",
23
+ "@stryke/type-checks": "^0.1.4",
24
+ "@stryke/types": "^0.7.4"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/node": "^22.13.1",