@reliverse/relifso 1.4.2 → 1.4.3

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
@@ -129,6 +129,71 @@ console.log(config); // { hello: 'world' }
129
129
  await remove(".reliverse");
130
130
  ```
131
131
 
132
+ ## Run Example
133
+
134
+ Install this repository locally and run the example by using `bun dev`:
135
+
136
+ ```bash
137
+ $ bun e-mod.ts
138
+ ✓ Running examples with Bun...
139
+ Created directory ./tests-runtime
140
+ [env] writeJson was successfully executed in Bun (for JSON)
141
+ Wrote JSON tests-runtime\config.json
142
+ [env] readJson was successfully executed in Bun
143
+ Read JSON {"hello":"world","ts":"2025-06-02T19:01:53.291Z"}
144
+ [env] copy was successfully executed in Bun
145
+ Moved → Copied (with overwrite) tests-runtime\config.old.json → tests-runtime\config.copy.json
146
+ [env] readFile was successfully executed in Bun
147
+ Wrote & read text file Hello Relifso!
148
+ [env] writeFile was successfully executed in Bun
149
+ [env] writeFile was successfully executed in Bun
150
+ Ensured nested & output files
151
+ [env] writeJson was successfully executed in Bun (for JSON)
152
+ [env] readJson was successfully executed in Bun
153
+ writeJson / readJson round-trip {"foo":"bar"}
154
+ [env] writeJson was successfully executed in Bun (for JSONC)
155
+ Wrote JSONC tests-runtime\config.jsonc
156
+ [env] readJson was successfully executed in Bun
157
+ Read JSONC {
158
+ "name": "relifso",
159
+ "version": "1.0.0",
160
+ "features": [
161
+ "file operations",
162
+ "directory operations",
163
+ "JSONC support"
164
+ ],
165
+ "settings": {
166
+ "debug": true,
167
+ "verbose": false
168
+ }
169
+ }
170
+ Emptied directory tests-runtime\empty-me
171
+ [env] writeFileSync was successfully executed in Bun
172
+ [env] writeJsonSync was successfully executed in Bun (for JSON)
173
+ Sync JSON round-trip {"sync":true}
174
+ [env] copySync was successfully executed in Bun
175
+ copySync → moveSync → removeSync chain complete
176
+ Directory structure via dive
177
+ • tests-runtime\config-sync.json
178
+ • tests-runtime\config.copy.json
179
+ • tests-runtime\config.jsonc
180
+ • tests-runtime\config.old.json
181
+ • tests-runtime\config2.json
182
+ • tests-runtime\hello.txt
183
+ • tests-runtime\nested\deep\file.txt
184
+ • tests-runtime\output-file.txt
185
+ Directory structure via diveSync
186
+ • tests-runtime\config-sync.json
187
+ • tests-runtime\config.copy.json
188
+ • tests-runtime\config.jsonc
189
+ • tests-runtime\config.old.json
190
+ • tests-runtime\config2.json
191
+ • tests-runtime\hello.txt
192
+ • tests-runtime\nested\deep\file.txt
193
+ • tests-runtime\output-file.txt
194
+ Removed directory ./tests-runtime
195
+ ```
196
+
132
197
  ## Sync vs Async vs Legacy
133
198
 
134
199
  You choose your flavor:
@@ -1,7 +1,7 @@
1
1
  export interface CopyOptions {
2
- /** Whether to overwrite existing files. Default: true */
2
+ /** @deprecated Use `overwrite` instead. This option will be removed in a future. */
3
3
  force?: boolean;
4
- /** Whether to overwrite existing files. Alias for force. Default: true */
4
+ /** Whether to overwrite existing files. Default: true */
5
5
  overwrite?: boolean;
6
6
  /** @deprecated Use `overwrite`. */
7
7
  clobber?: boolean;
package/bin/impl/copy.js CHANGED
@@ -29,7 +29,7 @@ export function copySync(src, dest, options = {}) {
29
29
  const {
30
30
  overwrite = options.clobber ?? true,
31
31
  force = true,
32
- recursive = false,
32
+ recursive = true,
33
33
  dereference = false,
34
34
  errorOnExist = false,
35
35
  ensureSource = true,
@@ -124,7 +124,7 @@ export async function copy(src, dest, options = {}) {
124
124
  const {
125
125
  overwrite = options.clobber ?? true,
126
126
  force = true,
127
- recursive = false,
127
+ recursive = true,
128
128
  dereference = false,
129
129
  errorOnExist = false,
130
130
  ensureSource = true,
@@ -1,4 +1,7 @@
1
1
  export interface MoveOptions {
2
+ /** @deprecated Use `overwrite` instead. This option will be removed in a future. */
3
+ force?: boolean;
4
+ /** Whether to overwrite existing files. Default: false */
2
5
  overwrite?: boolean;
3
6
  /** @deprecated Use `overwrite`. */
4
7
  clobber?: boolean;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "license": "MIT",
6
6
  "name": "@reliverse/relifso",
7
7
  "type": "module",
8
- "version": "1.4.2",
8
+ "version": "1.4.3",
9
9
  "keywords": [
10
10
  "fs",
11
11
  "file",