@visulima/fs 2.2.1 → 2.3.0

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 (57) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE.md +0 -3
  3. package/README.md +3745 -0
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.d.cts +27 -4
  6. package/dist/index.d.mts +27 -4
  7. package/dist/index.d.ts +27 -4
  8. package/dist/index.mjs +1 -1
  9. package/dist/packem_shared/F_OK-6WAweffB.cjs +1 -0
  10. package/dist/packem_shared/F_OK-B71i3mUa.mjs +1 -0
  11. package/dist/packem_shared/{findUp-DuKqk_9D.mjs → findUp-CMGMYNty.mjs} +1 -1
  12. package/dist/packem_shared/{findUp-DWKie4QO.cjs → findUp-VKPTLmQQ.cjs} +1 -1
  13. package/dist/packem_shared/{findUpSync-Y1Jpw0nr.cjs → findUpSync-BFwDGxkV.cjs} +1 -1
  14. package/dist/packem_shared/{findUpSync-Cal_fll7.mjs → findUpSync-QP_ZEsJN.mjs} +1 -1
  15. package/dist/packem_shared/{isAccessible-C58XjRjT.cjs → isAccessible-Be3NKjOk.cjs} +1 -1
  16. package/dist/packem_shared/{isAccessible-vmOjbVOF.mjs → isAccessible-cO53WedI.mjs} +1 -1
  17. package/dist/packem_shared/{isAccessibleSync-BxoK0UkJ.mjs → isAccessibleSync-D5Vc2GTD.mjs} +1 -1
  18. package/dist/packem_shared/{isAccessibleSync-9njSth1z.cjs → isAccessibleSync-WOSgkAy2.cjs} +1 -1
  19. package/dist/packem_shared/move-MZ9F6paN.mjs +1 -0
  20. package/dist/packem_shared/move-j3mzcWrG.cjs +1 -0
  21. package/dist/packem_shared/{parseJson-Ci9N3Kqh.mjs → parseJson-BIYrZWHm.mjs} +5 -5
  22. package/dist/packem_shared/{parseJson-aI1tthJV.cjs → parseJson-CXe73j5t.cjs} +4 -4
  23. package/dist/packem_shared/{readFile-D6U3MP6g.mjs → readFile-CFus1Rym.mjs} +1 -1
  24. package/dist/packem_shared/{readFile-DIQKBQ0d.cjs → readFile-fzYtUKuW.cjs} +1 -1
  25. package/dist/packem_shared/{readFileSync-CTVwduD2.cjs → readFileSync-Dz4jLcWc.cjs} +1 -1
  26. package/dist/packem_shared/{readFileSync-Bao-E5R8.mjs → readFileSync-Ulz6QzOz.mjs} +1 -1
  27. package/dist/packem_shared/{readJson-fgrin-Wb.mjs → readJson-C6RN16Rf.mjs} +1 -1
  28. package/dist/packem_shared/{readJson-Cf5QS1cQ.cjs → readJson-D7_CYUJX.cjs} +1 -1
  29. package/dist/packem_shared/readJsonSync-QziPGqW_.cjs +1 -0
  30. package/dist/packem_shared/readJsonSync-ztZXpE8z.mjs +1 -0
  31. package/dist/packem_shared/{readYaml-D4PbAXZD.cjs → readYaml-C-ui8qXw.cjs} +1 -1
  32. package/dist/packem_shared/{readYaml-BYMJDJU0.mjs → readYaml-aFHfT-4e.mjs} +1 -1
  33. package/dist/packem_shared/{readYamlSync-CdYj75zz.mjs → readYamlSync-CeJ6RnoJ.mjs} +1 -1
  34. package/dist/packem_shared/{readYamlSync-Bnyr8iGt.cjs → readYamlSync-DUYMSemC.cjs} +1 -1
  35. package/dist/packem_shared/stripJsonComments-CKgR4nW4.mjs +1 -0
  36. package/dist/packem_shared/stripJsonComments-Cw7UCxI3.cjs +1 -0
  37. package/dist/packem_shared/{writeFile-DwkUvAF-.mjs → writeFile-DaHzc_FW.mjs} +1 -1
  38. package/dist/packem_shared/{writeFile-z1NYn8jk.cjs → writeFile-WCuWZNRy.cjs} +1 -1
  39. package/dist/packem_shared/{writeFileSync-DYhY33yC.mjs → writeFileSync-D9HGh6J-.mjs} +1 -1
  40. package/dist/packem_shared/{writeFileSync-rAuaAA6w.cjs → writeFileSync-Ds49_ORi.cjs} +1 -1
  41. package/dist/packem_shared/{writeJson-BW5_Vr5i.cjs → writeJson-BdjtBy1t.cjs} +1 -1
  42. package/dist/packem_shared/{writeJson-DI_vpDVy.mjs → writeJson-Bu7Dw4Uu.mjs} +1 -1
  43. package/dist/packem_shared/{writeJsonSync-DLo6ZPEV.mjs → writeJsonSync-7CjNn7oo.mjs} +1 -1
  44. package/dist/packem_shared/{writeJsonSync-BkoMtNUG.cjs → writeJsonSync-CdC3ahaO.cjs} +1 -1
  45. package/dist/packem_shared/{writeYaml-BO_bcnqK.cjs → writeYaml-COWffUNm.cjs} +1 -1
  46. package/dist/packem_shared/{writeYaml-B4jtxffY.mjs → writeYaml-bi1dx696.mjs} +1 -1
  47. package/dist/packem_shared/{writeYamlSync-DozAaY0A.cjs → writeYamlSync-BpIN1tTP.cjs} +1 -1
  48. package/dist/packem_shared/{writeYamlSync-BG69YBbH.mjs → writeYamlSync-D2VPlEws.mjs} +1 -1
  49. package/dist/utils.cjs +1 -1
  50. package/dist/utils.mjs +1 -1
  51. package/package.json +17 -13
  52. package/dist/packem_shared/F_OK-B8R_JA-Q.cjs +0 -1
  53. package/dist/packem_shared/F_OK-CiLqIeYK.mjs +0 -1
  54. package/dist/packem_shared/readJsonSync-D2_W7t7m.mjs +0 -1
  55. package/dist/packem_shared/readJsonSync-Dzu0ErIN.cjs +0 -1
  56. package/dist/packem_shared/stripJsonComments-BG8VWVP8.cjs +0 -1
  57. package/dist/packem_shared/stripJsonComments-CnWkqJaX.mjs +0 -1
package/README.md CHANGED
@@ -433,6 +433,3751 @@ Type: `string`
433
433
 
434
434
  The printable section of the JSON which produces the error.
435
435
 
436
+ ## Api Docs
437
+
438
+ <!-- TYPEDOC -->
439
+
440
+ # error
441
+
442
+ ## Classes
443
+
444
+ ### AlreadyExistsError
445
+
446
+ Error thrown when file already exists.
447
+
448
+ #### Extends
449
+
450
+ - `Error`
451
+
452
+ #### Constructors
453
+
454
+ ##### new AlreadyExistsError()
455
+
456
+ ```ts
457
+ new AlreadyExistsError(message): AlreadyExistsError
458
+ ```
459
+
460
+ Creates a new instance.
461
+
462
+ ###### Parameters
463
+
464
+ • **message**: `string`
465
+
466
+ The error message.
467
+
468
+ ###### Returns
469
+
470
+ [`AlreadyExistsError`](error.md#alreadyexistserror)
471
+
472
+ ###### Overrides
473
+
474
+ `Error.constructor`
475
+
476
+ ###### Defined in
477
+
478
+ [packages/fs/src/error/already-exists-error.ts:9](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/already-exists-error.ts#L9)
479
+
480
+ #### Accessors
481
+
482
+ ##### code
483
+
484
+ ```ts
485
+ get code(): string
486
+ ```
487
+
488
+ ```ts
489
+ set code(_name): void
490
+ ```
491
+
492
+ ###### Parameters
493
+
494
+ • **\_name**: `string`
495
+
496
+ ###### Returns
497
+
498
+ `string`
499
+
500
+ ###### Defined in
501
+
502
+ [packages/fs/src/error/already-exists-error.ts:14](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/already-exists-error.ts#L14)
503
+
504
+ ##### name
505
+
506
+ ```ts
507
+ get name(): string
508
+ ```
509
+
510
+ ```ts
511
+ set name(_name): void
512
+ ```
513
+
514
+ ###### Parameters
515
+
516
+ • **\_name**: `string`
517
+
518
+ ###### Returns
519
+
520
+ `string`
521
+
522
+ ###### Overrides
523
+
524
+ `Error.name`
525
+
526
+ ###### Defined in
527
+
528
+ [packages/fs/src/error/already-exists-error.ts:24](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/already-exists-error.ts#L24)
529
+
530
+ #### Methods
531
+
532
+ ##### captureStackTrace()
533
+
534
+ ```ts
535
+ static captureStackTrace(targetObject, constructorOpt?): void
536
+ ```
537
+
538
+ Create .stack property on a target object
539
+
540
+ ###### Parameters
541
+
542
+ • **targetObject**: `object`
543
+
544
+ • **constructorOpt?**: `Function`
545
+
546
+ ###### Returns
547
+
548
+ `void`
549
+
550
+ ###### Inherited from
551
+
552
+ `Error.captureStackTrace`
553
+
554
+ ###### Defined in
555
+
556
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:20
557
+
558
+ #### Properties
559
+
560
+ ##### cause?
561
+
562
+ ```ts
563
+ optional cause: unknown;
564
+ ```
565
+
566
+ ###### Inherited from
567
+
568
+ `Error.cause`
569
+
570
+ ###### Defined in
571
+
572
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24
573
+
574
+ ##### message
575
+
576
+ ```ts
577
+ message: string;
578
+ ```
579
+
580
+ ###### Inherited from
581
+
582
+ `Error.message`
583
+
584
+ ###### Defined in
585
+
586
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es5.d.ts:1077
587
+
588
+ ##### stack?
589
+
590
+ ```ts
591
+ optional stack: string;
592
+ ```
593
+
594
+ ###### Inherited from
595
+
596
+ `Error.stack`
597
+
598
+ ###### Defined in
599
+
600
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es5.d.ts:1078
601
+
602
+ ##### prepareStackTrace()?
603
+
604
+ ```ts
605
+ static optional prepareStackTrace: (err, stackTraces) => any;
606
+ ```
607
+
608
+ Optional override for formatting stack traces
609
+
610
+ ###### Parameters
611
+
612
+ • **err**: `Error`
613
+
614
+ • **stackTraces**: `CallSite`[]
615
+
616
+ ###### Returns
617
+
618
+ `any`
619
+
620
+ ###### See
621
+
622
+ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
623
+
624
+ ###### Inherited from
625
+
626
+ `Error.prepareStackTrace`
627
+
628
+ ###### Defined in
629
+
630
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:27
631
+
632
+ ##### stackTraceLimit
633
+
634
+ ```ts
635
+ static stackTraceLimit: number;
636
+ ```
637
+
638
+ ###### Inherited from
639
+
640
+ `Error.stackTraceLimit`
641
+
642
+ ###### Defined in
643
+
644
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:29
645
+
646
+ ***
647
+
648
+ ### DirectoryError
649
+
650
+ Error thrown when an operation is not allowed on a directory.
651
+
652
+ #### Extends
653
+
654
+ - `Error`
655
+
656
+ #### Constructors
657
+
658
+ ##### new DirectoryError()
659
+
660
+ ```ts
661
+ new DirectoryError(message): DirectoryError
662
+ ```
663
+
664
+ Creates a new instance.
665
+
666
+ ###### Parameters
667
+
668
+ • **message**: `string`
669
+
670
+ The error message.
671
+
672
+ ###### Returns
673
+
674
+ [`DirectoryError`](error.md#directoryerror)
675
+
676
+ ###### Overrides
677
+
678
+ `Error.constructor`
679
+
680
+ ###### Defined in
681
+
682
+ [packages/fs/src/error/directory-error.ts:9](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/directory-error.ts#L9)
683
+
684
+ #### Accessors
685
+
686
+ ##### code
687
+
688
+ ```ts
689
+ get code(): string
690
+ ```
691
+
692
+ ```ts
693
+ set code(_name): void
694
+ ```
695
+
696
+ ###### Parameters
697
+
698
+ • **\_name**: `string`
699
+
700
+ ###### Returns
701
+
702
+ `string`
703
+
704
+ ###### Defined in
705
+
706
+ [packages/fs/src/error/directory-error.ts:14](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/directory-error.ts#L14)
707
+
708
+ ##### name
709
+
710
+ ```ts
711
+ get name(): string
712
+ ```
713
+
714
+ ```ts
715
+ set name(_name): void
716
+ ```
717
+
718
+ ###### Parameters
719
+
720
+ • **\_name**: `string`
721
+
722
+ ###### Returns
723
+
724
+ `string`
725
+
726
+ ###### Overrides
727
+
728
+ `Error.name`
729
+
730
+ ###### Defined in
731
+
732
+ [packages/fs/src/error/directory-error.ts:24](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/directory-error.ts#L24)
733
+
734
+ #### Methods
735
+
736
+ ##### captureStackTrace()
737
+
738
+ ```ts
739
+ static captureStackTrace(targetObject, constructorOpt?): void
740
+ ```
741
+
742
+ Create .stack property on a target object
743
+
744
+ ###### Parameters
745
+
746
+ • **targetObject**: `object`
747
+
748
+ • **constructorOpt?**: `Function`
749
+
750
+ ###### Returns
751
+
752
+ `void`
753
+
754
+ ###### Inherited from
755
+
756
+ `Error.captureStackTrace`
757
+
758
+ ###### Defined in
759
+
760
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:20
761
+
762
+ #### Properties
763
+
764
+ ##### cause?
765
+
766
+ ```ts
767
+ optional cause: unknown;
768
+ ```
769
+
770
+ ###### Inherited from
771
+
772
+ `Error.cause`
773
+
774
+ ###### Defined in
775
+
776
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24
777
+
778
+ ##### message
779
+
780
+ ```ts
781
+ message: string;
782
+ ```
783
+
784
+ ###### Inherited from
785
+
786
+ `Error.message`
787
+
788
+ ###### Defined in
789
+
790
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es5.d.ts:1077
791
+
792
+ ##### stack?
793
+
794
+ ```ts
795
+ optional stack: string;
796
+ ```
797
+
798
+ ###### Inherited from
799
+
800
+ `Error.stack`
801
+
802
+ ###### Defined in
803
+
804
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es5.d.ts:1078
805
+
806
+ ##### prepareStackTrace()?
807
+
808
+ ```ts
809
+ static optional prepareStackTrace: (err, stackTraces) => any;
810
+ ```
811
+
812
+ Optional override for formatting stack traces
813
+
814
+ ###### Parameters
815
+
816
+ • **err**: `Error`
817
+
818
+ • **stackTraces**: `CallSite`[]
819
+
820
+ ###### Returns
821
+
822
+ `any`
823
+
824
+ ###### See
825
+
826
+ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
827
+
828
+ ###### Inherited from
829
+
830
+ `Error.prepareStackTrace`
831
+
832
+ ###### Defined in
833
+
834
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:27
835
+
836
+ ##### stackTraceLimit
837
+
838
+ ```ts
839
+ static stackTraceLimit: number;
840
+ ```
841
+
842
+ ###### Inherited from
843
+
844
+ `Error.stackTraceLimit`
845
+
846
+ ###### Defined in
847
+
848
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:29
849
+
850
+ ***
851
+
852
+ ### NotEmptyError
853
+
854
+ Error thrown when a directory is not empty.
855
+
856
+ #### Extends
857
+
858
+ - `Error`
859
+
860
+ #### Constructors
861
+
862
+ ##### new NotEmptyError()
863
+
864
+ ```ts
865
+ new NotEmptyError(message): NotEmptyError
866
+ ```
867
+
868
+ Creates a new instance.
869
+
870
+ ###### Parameters
871
+
872
+ • **message**: `string`
873
+
874
+ The error message.
875
+
876
+ ###### Returns
877
+
878
+ [`NotEmptyError`](error.md#notemptyerror)
879
+
880
+ ###### Overrides
881
+
882
+ `Error.constructor`
883
+
884
+ ###### Defined in
885
+
886
+ [packages/fs/src/error/not-empty-error.ts:9](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/not-empty-error.ts#L9)
887
+
888
+ #### Accessors
889
+
890
+ ##### code
891
+
892
+ ```ts
893
+ get code(): string
894
+ ```
895
+
896
+ ```ts
897
+ set code(_name): void
898
+ ```
899
+
900
+ ###### Parameters
901
+
902
+ • **\_name**: `string`
903
+
904
+ ###### Returns
905
+
906
+ `string`
907
+
908
+ ###### Defined in
909
+
910
+ [packages/fs/src/error/not-empty-error.ts:14](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/not-empty-error.ts#L14)
911
+
912
+ ##### name
913
+
914
+ ```ts
915
+ get name(): string
916
+ ```
917
+
918
+ ```ts
919
+ set name(_name): void
920
+ ```
921
+
922
+ ###### Parameters
923
+
924
+ • **\_name**: `string`
925
+
926
+ ###### Returns
927
+
928
+ `string`
929
+
930
+ ###### Overrides
931
+
932
+ `Error.name`
933
+
934
+ ###### Defined in
935
+
936
+ [packages/fs/src/error/not-empty-error.ts:24](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/not-empty-error.ts#L24)
937
+
938
+ #### Methods
939
+
940
+ ##### captureStackTrace()
941
+
942
+ ```ts
943
+ static captureStackTrace(targetObject, constructorOpt?): void
944
+ ```
945
+
946
+ Create .stack property on a target object
947
+
948
+ ###### Parameters
949
+
950
+ • **targetObject**: `object`
951
+
952
+ • **constructorOpt?**: `Function`
953
+
954
+ ###### Returns
955
+
956
+ `void`
957
+
958
+ ###### Inherited from
959
+
960
+ `Error.captureStackTrace`
961
+
962
+ ###### Defined in
963
+
964
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:20
965
+
966
+ #### Properties
967
+
968
+ ##### cause?
969
+
970
+ ```ts
971
+ optional cause: unknown;
972
+ ```
973
+
974
+ ###### Inherited from
975
+
976
+ `Error.cause`
977
+
978
+ ###### Defined in
979
+
980
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24
981
+
982
+ ##### message
983
+
984
+ ```ts
985
+ message: string;
986
+ ```
987
+
988
+ ###### Inherited from
989
+
990
+ `Error.message`
991
+
992
+ ###### Defined in
993
+
994
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es5.d.ts:1077
995
+
996
+ ##### stack?
997
+
998
+ ```ts
999
+ optional stack: string;
1000
+ ```
1001
+
1002
+ ###### Inherited from
1003
+
1004
+ `Error.stack`
1005
+
1006
+ ###### Defined in
1007
+
1008
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es5.d.ts:1078
1009
+
1010
+ ##### prepareStackTrace()?
1011
+
1012
+ ```ts
1013
+ static optional prepareStackTrace: (err, stackTraces) => any;
1014
+ ```
1015
+
1016
+ Optional override for formatting stack traces
1017
+
1018
+ ###### Parameters
1019
+
1020
+ • **err**: `Error`
1021
+
1022
+ • **stackTraces**: `CallSite`[]
1023
+
1024
+ ###### Returns
1025
+
1026
+ `any`
1027
+
1028
+ ###### See
1029
+
1030
+ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
1031
+
1032
+ ###### Inherited from
1033
+
1034
+ `Error.prepareStackTrace`
1035
+
1036
+ ###### Defined in
1037
+
1038
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:27
1039
+
1040
+ ##### stackTraceLimit
1041
+
1042
+ ```ts
1043
+ static stackTraceLimit: number;
1044
+ ```
1045
+
1046
+ ###### Inherited from
1047
+
1048
+ `Error.stackTraceLimit`
1049
+
1050
+ ###### Defined in
1051
+
1052
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:29
1053
+
1054
+ ***
1055
+
1056
+ ### NotFoundError
1057
+
1058
+ Error thrown when a file or directory is not found.
1059
+
1060
+ #### Extends
1061
+
1062
+ - `Error`
1063
+
1064
+ #### Constructors
1065
+
1066
+ ##### new NotFoundError()
1067
+
1068
+ ```ts
1069
+ new NotFoundError(message): NotFoundError
1070
+ ```
1071
+
1072
+ Creates a new instance.
1073
+
1074
+ ###### Parameters
1075
+
1076
+ • **message**: `string`
1077
+
1078
+ The error message.
1079
+
1080
+ ###### Returns
1081
+
1082
+ [`NotFoundError`](error.md#notfounderror)
1083
+
1084
+ ###### Overrides
1085
+
1086
+ `Error.constructor`
1087
+
1088
+ ###### Defined in
1089
+
1090
+ [packages/fs/src/error/not-found-error.ts:9](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/not-found-error.ts#L9)
1091
+
1092
+ #### Accessors
1093
+
1094
+ ##### code
1095
+
1096
+ ```ts
1097
+ get code(): string
1098
+ ```
1099
+
1100
+ ```ts
1101
+ set code(_name): void
1102
+ ```
1103
+
1104
+ ###### Parameters
1105
+
1106
+ • **\_name**: `string`
1107
+
1108
+ ###### Returns
1109
+
1110
+ `string`
1111
+
1112
+ ###### Defined in
1113
+
1114
+ [packages/fs/src/error/not-found-error.ts:14](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/not-found-error.ts#L14)
1115
+
1116
+ ##### name
1117
+
1118
+ ```ts
1119
+ get name(): string
1120
+ ```
1121
+
1122
+ ```ts
1123
+ set name(_name): void
1124
+ ```
1125
+
1126
+ ###### Parameters
1127
+
1128
+ • **\_name**: `string`
1129
+
1130
+ ###### Returns
1131
+
1132
+ `string`
1133
+
1134
+ ###### Overrides
1135
+
1136
+ `Error.name`
1137
+
1138
+ ###### Defined in
1139
+
1140
+ [packages/fs/src/error/not-found-error.ts:24](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/not-found-error.ts#L24)
1141
+
1142
+ #### Methods
1143
+
1144
+ ##### captureStackTrace()
1145
+
1146
+ ```ts
1147
+ static captureStackTrace(targetObject, constructorOpt?): void
1148
+ ```
1149
+
1150
+ Create .stack property on a target object
1151
+
1152
+ ###### Parameters
1153
+
1154
+ • **targetObject**: `object`
1155
+
1156
+ • **constructorOpt?**: `Function`
1157
+
1158
+ ###### Returns
1159
+
1160
+ `void`
1161
+
1162
+ ###### Inherited from
1163
+
1164
+ `Error.captureStackTrace`
1165
+
1166
+ ###### Defined in
1167
+
1168
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:20
1169
+
1170
+ #### Properties
1171
+
1172
+ ##### cause?
1173
+
1174
+ ```ts
1175
+ optional cause: unknown;
1176
+ ```
1177
+
1178
+ ###### Inherited from
1179
+
1180
+ `Error.cause`
1181
+
1182
+ ###### Defined in
1183
+
1184
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24
1185
+
1186
+ ##### message
1187
+
1188
+ ```ts
1189
+ message: string;
1190
+ ```
1191
+
1192
+ ###### Inherited from
1193
+
1194
+ `Error.message`
1195
+
1196
+ ###### Defined in
1197
+
1198
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es5.d.ts:1077
1199
+
1200
+ ##### stack?
1201
+
1202
+ ```ts
1203
+ optional stack: string;
1204
+ ```
1205
+
1206
+ ###### Inherited from
1207
+
1208
+ `Error.stack`
1209
+
1210
+ ###### Defined in
1211
+
1212
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es5.d.ts:1078
1213
+
1214
+ ##### prepareStackTrace()?
1215
+
1216
+ ```ts
1217
+ static optional prepareStackTrace: (err, stackTraces) => any;
1218
+ ```
1219
+
1220
+ Optional override for formatting stack traces
1221
+
1222
+ ###### Parameters
1223
+
1224
+ • **err**: `Error`
1225
+
1226
+ • **stackTraces**: `CallSite`[]
1227
+
1228
+ ###### Returns
1229
+
1230
+ `any`
1231
+
1232
+ ###### See
1233
+
1234
+ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
1235
+
1236
+ ###### Inherited from
1237
+
1238
+ `Error.prepareStackTrace`
1239
+
1240
+ ###### Defined in
1241
+
1242
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:27
1243
+
1244
+ ##### stackTraceLimit
1245
+
1246
+ ```ts
1247
+ static stackTraceLimit: number;
1248
+ ```
1249
+
1250
+ ###### Inherited from
1251
+
1252
+ `Error.stackTraceLimit`
1253
+
1254
+ ###### Defined in
1255
+
1256
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:29
1257
+
1258
+ ***
1259
+
1260
+ ### PermissionError
1261
+
1262
+ Error thrown when an operation is not permitted.
1263
+
1264
+ #### Extends
1265
+
1266
+ - `Error`
1267
+
1268
+ #### Constructors
1269
+
1270
+ ##### new PermissionError()
1271
+
1272
+ ```ts
1273
+ new PermissionError(message): PermissionError
1274
+ ```
1275
+
1276
+ Creates a new instance.
1277
+
1278
+ ###### Parameters
1279
+
1280
+ • **message**: `string`
1281
+
1282
+ The error message.
1283
+
1284
+ ###### Returns
1285
+
1286
+ [`PermissionError`](error.md#permissionerror)
1287
+
1288
+ ###### Overrides
1289
+
1290
+ `Error.constructor`
1291
+
1292
+ ###### Defined in
1293
+
1294
+ [packages/fs/src/error/permission-error.ts:9](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/permission-error.ts#L9)
1295
+
1296
+ #### Accessors
1297
+
1298
+ ##### code
1299
+
1300
+ ```ts
1301
+ get code(): string
1302
+ ```
1303
+
1304
+ ```ts
1305
+ set code(_name): void
1306
+ ```
1307
+
1308
+ ###### Parameters
1309
+
1310
+ • **\_name**: `string`
1311
+
1312
+ ###### Returns
1313
+
1314
+ `string`
1315
+
1316
+ ###### Defined in
1317
+
1318
+ [packages/fs/src/error/permission-error.ts:14](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/permission-error.ts#L14)
1319
+
1320
+ ##### name
1321
+
1322
+ ```ts
1323
+ get name(): string
1324
+ ```
1325
+
1326
+ ```ts
1327
+ set name(_name): void
1328
+ ```
1329
+
1330
+ ###### Parameters
1331
+
1332
+ • **\_name**: `string`
1333
+
1334
+ ###### Returns
1335
+
1336
+ `string`
1337
+
1338
+ ###### Overrides
1339
+
1340
+ `Error.name`
1341
+
1342
+ ###### Defined in
1343
+
1344
+ [packages/fs/src/error/permission-error.ts:24](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/permission-error.ts#L24)
1345
+
1346
+ #### Methods
1347
+
1348
+ ##### captureStackTrace()
1349
+
1350
+ ```ts
1351
+ static captureStackTrace(targetObject, constructorOpt?): void
1352
+ ```
1353
+
1354
+ Create .stack property on a target object
1355
+
1356
+ ###### Parameters
1357
+
1358
+ • **targetObject**: `object`
1359
+
1360
+ • **constructorOpt?**: `Function`
1361
+
1362
+ ###### Returns
1363
+
1364
+ `void`
1365
+
1366
+ ###### Inherited from
1367
+
1368
+ `Error.captureStackTrace`
1369
+
1370
+ ###### Defined in
1371
+
1372
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:20
1373
+
1374
+ #### Properties
1375
+
1376
+ ##### cause?
1377
+
1378
+ ```ts
1379
+ optional cause: unknown;
1380
+ ```
1381
+
1382
+ ###### Inherited from
1383
+
1384
+ `Error.cause`
1385
+
1386
+ ###### Defined in
1387
+
1388
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24
1389
+
1390
+ ##### message
1391
+
1392
+ ```ts
1393
+ message: string;
1394
+ ```
1395
+
1396
+ ###### Inherited from
1397
+
1398
+ `Error.message`
1399
+
1400
+ ###### Defined in
1401
+
1402
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es5.d.ts:1077
1403
+
1404
+ ##### stack?
1405
+
1406
+ ```ts
1407
+ optional stack: string;
1408
+ ```
1409
+
1410
+ ###### Inherited from
1411
+
1412
+ `Error.stack`
1413
+
1414
+ ###### Defined in
1415
+
1416
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es5.d.ts:1078
1417
+
1418
+ ##### prepareStackTrace()?
1419
+
1420
+ ```ts
1421
+ static optional prepareStackTrace: (err, stackTraces) => any;
1422
+ ```
1423
+
1424
+ Optional override for formatting stack traces
1425
+
1426
+ ###### Parameters
1427
+
1428
+ • **err**: `Error`
1429
+
1430
+ • **stackTraces**: `CallSite`[]
1431
+
1432
+ ###### Returns
1433
+
1434
+ `any`
1435
+
1436
+ ###### See
1437
+
1438
+ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
1439
+
1440
+ ###### Inherited from
1441
+
1442
+ `Error.prepareStackTrace`
1443
+
1444
+ ###### Defined in
1445
+
1446
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:27
1447
+
1448
+ ##### stackTraceLimit
1449
+
1450
+ ```ts
1451
+ static stackTraceLimit: number;
1452
+ ```
1453
+
1454
+ ###### Inherited from
1455
+
1456
+ `Error.stackTraceLimit`
1457
+
1458
+ ###### Defined in
1459
+
1460
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:29
1461
+
1462
+ ***
1463
+
1464
+ ### WalkError
1465
+
1466
+ Error thrown in walk or walkSync during iteration.
1467
+
1468
+ #### Extends
1469
+
1470
+ - `Error`
1471
+
1472
+ #### Constructors
1473
+
1474
+ ##### new WalkError()
1475
+
1476
+ ```ts
1477
+ new WalkError(cause, root): WalkError
1478
+ ```
1479
+
1480
+ Constructs a new instance.
1481
+
1482
+ ###### Parameters
1483
+
1484
+ • **cause**: `unknown`
1485
+
1486
+ • **root**: `string`
1487
+
1488
+ ###### Returns
1489
+
1490
+ [`WalkError`](error.md#walkerror)
1491
+
1492
+ ###### Overrides
1493
+
1494
+ `Error.constructor`
1495
+
1496
+ ###### Defined in
1497
+
1498
+ [packages/fs/src/error/walk-error.ts:12](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/walk-error.ts#L12)
1499
+
1500
+ #### Accessors
1501
+
1502
+ ##### name
1503
+
1504
+ ```ts
1505
+ get name(): string
1506
+ ```
1507
+
1508
+ ```ts
1509
+ set name(_name): void
1510
+ ```
1511
+
1512
+ ###### Parameters
1513
+
1514
+ • **\_name**: `string`
1515
+
1516
+ ###### Returns
1517
+
1518
+ `string`
1519
+
1520
+ ###### Overrides
1521
+
1522
+ `Error.name`
1523
+
1524
+ ###### Defined in
1525
+
1526
+ [packages/fs/src/error/walk-error.ts:21](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/walk-error.ts#L21)
1527
+
1528
+ #### Methods
1529
+
1530
+ ##### captureStackTrace()
1531
+
1532
+ ```ts
1533
+ static captureStackTrace(targetObject, constructorOpt?): void
1534
+ ```
1535
+
1536
+ Create .stack property on a target object
1537
+
1538
+ ###### Parameters
1539
+
1540
+ • **targetObject**: `object`
1541
+
1542
+ • **constructorOpt?**: `Function`
1543
+
1544
+ ###### Returns
1545
+
1546
+ `void`
1547
+
1548
+ ###### Inherited from
1549
+
1550
+ `Error.captureStackTrace`
1551
+
1552
+ ###### Defined in
1553
+
1554
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:20
1555
+
1556
+ #### Properties
1557
+
1558
+ ##### cause?
1559
+
1560
+ ```ts
1561
+ optional cause: unknown;
1562
+ ```
1563
+
1564
+ ###### Inherited from
1565
+
1566
+ `Error.cause`
1567
+
1568
+ ###### Defined in
1569
+
1570
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24
1571
+
1572
+ ##### message
1573
+
1574
+ ```ts
1575
+ message: string;
1576
+ ```
1577
+
1578
+ ###### Inherited from
1579
+
1580
+ `Error.message`
1581
+
1582
+ ###### Defined in
1583
+
1584
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es5.d.ts:1077
1585
+
1586
+ ##### root
1587
+
1588
+ ```ts
1589
+ root: string;
1590
+ ```
1591
+
1592
+ File path of the root that's being walked.
1593
+
1594
+ ###### Defined in
1595
+
1596
+ [packages/fs/src/error/walk-error.ts:9](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/walk-error.ts#L9)
1597
+
1598
+ ##### stack?
1599
+
1600
+ ```ts
1601
+ optional stack: string;
1602
+ ```
1603
+
1604
+ ###### Inherited from
1605
+
1606
+ `Error.stack`
1607
+
1608
+ ###### Defined in
1609
+
1610
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es5.d.ts:1078
1611
+
1612
+ ##### prepareStackTrace()?
1613
+
1614
+ ```ts
1615
+ static optional prepareStackTrace: (err, stackTraces) => any;
1616
+ ```
1617
+
1618
+ Optional override for formatting stack traces
1619
+
1620
+ ###### Parameters
1621
+
1622
+ • **err**: `Error`
1623
+
1624
+ • **stackTraces**: `CallSite`[]
1625
+
1626
+ ###### Returns
1627
+
1628
+ `any`
1629
+
1630
+ ###### See
1631
+
1632
+ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
1633
+
1634
+ ###### Inherited from
1635
+
1636
+ `Error.prepareStackTrace`
1637
+
1638
+ ###### Defined in
1639
+
1640
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:27
1641
+
1642
+ ##### stackTraceLimit
1643
+
1644
+ ```ts
1645
+ static stackTraceLimit: number;
1646
+ ```
1647
+
1648
+ ###### Inherited from
1649
+
1650
+ `Error.stackTraceLimit`
1651
+
1652
+ ###### Defined in
1653
+
1654
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:29
1655
+
1656
+ ## References
1657
+
1658
+ ### JSONError
1659
+
1660
+ Re-exports [JSONError](utils.md#jsonerror)
1661
+ # index
1662
+
1663
+ ## Functions
1664
+
1665
+ ### collect()
1666
+
1667
+ ```ts
1668
+ function collect(directory, options): Promise<string[]>
1669
+ ```
1670
+
1671
+ #### Parameters
1672
+
1673
+ • **directory**: `string`
1674
+
1675
+ • **options**: [`WalkOptions`](index.md#walkoptions) = `{}`
1676
+
1677
+ #### Returns
1678
+
1679
+ `Promise`\<`string`[]\>
1680
+
1681
+ #### Defined in
1682
+
1683
+ [packages/fs/src/find/collect.ts:4](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/find/collect.ts#L4)
1684
+
1685
+ ***
1686
+
1687
+ ### collectSync()
1688
+
1689
+ ```ts
1690
+ function collectSync(directory, options): string[]
1691
+ ```
1692
+
1693
+ #### Parameters
1694
+
1695
+ • **directory**: `string`
1696
+
1697
+ • **options**: [`WalkOptions`](index.md#walkoptions) = `{}`
1698
+
1699
+ #### Returns
1700
+
1701
+ `string`[]
1702
+
1703
+ #### Defined in
1704
+
1705
+ [packages/fs/src/find/collect-sync.ts:4](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/find/collect-sync.ts#L4)
1706
+
1707
+ ***
1708
+
1709
+ ### detect()
1710
+
1711
+ ```ts
1712
+ function detect(content): "\n" | "\r\n"
1713
+ ```
1714
+
1715
+ Detect the EOL character for string input.
1716
+ Returns null if no newline.
1717
+
1718
+ #### Parameters
1719
+
1720
+ • **content**: `string`
1721
+
1722
+ #### Returns
1723
+
1724
+ "\n" \| "\r\n"
1725
+
1726
+ #### Defined in
1727
+
1728
+ [packages/fs/src/eol.ts:20](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/eol.ts#L20)
1729
+
1730
+ ***
1731
+
1732
+ ### emptyDir()
1733
+
1734
+ ```ts
1735
+ function emptyDir(dir, options?): Promise<void>
1736
+ ```
1737
+
1738
+ Ensures that a directory is empty.
1739
+ Deletes directory contents if the directory is not empty.
1740
+ If the directory does not exist, it is created.
1741
+ The directory itself is not deleted.
1742
+
1743
+ #### Parameters
1744
+
1745
+ • **dir**: `string` \| `URL`
1746
+
1747
+ • **options?**: [`EmptyDirOptions`](index.md#emptydiroptions)
1748
+
1749
+ #### Returns
1750
+
1751
+ `Promise`\<`void`\>
1752
+
1753
+ #### Defined in
1754
+
1755
+ [packages/fs/src/remove/empty-dir.ts:19](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/remove/empty-dir.ts#L19)
1756
+
1757
+ ***
1758
+
1759
+ ### emptyDirSync()
1760
+
1761
+ ```ts
1762
+ function emptyDirSync(dir, options?): void
1763
+ ```
1764
+
1765
+ Ensures that a directory is empty.
1766
+ Deletes directory contents if the directory is not empty.
1767
+ If the directory does not exist, it is created.
1768
+ The directory itself is not deleted.
1769
+
1770
+ #### Parameters
1771
+
1772
+ • **dir**: `string` \| `URL`
1773
+
1774
+ • **options?**: [`EmptyDirOptions`](index.md#emptydiroptions)
1775
+
1776
+ #### Returns
1777
+
1778
+ `void`
1779
+
1780
+ #### Defined in
1781
+
1782
+ [packages/fs/src/remove/empty-dir-sync.ts:18](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/remove/empty-dir-sync.ts#L18)
1783
+
1784
+ ***
1785
+
1786
+ ### ensureDir()
1787
+
1788
+ ```ts
1789
+ function ensureDir(directory): Promise<void>
1790
+ ```
1791
+
1792
+ Ensures that the directory exists.
1793
+ If the directory structure does not exist, it is created. Like mkdir -p.
1794
+
1795
+ #### Parameters
1796
+
1797
+ • **directory**: `string` \| `URL`
1798
+
1799
+ #### Returns
1800
+
1801
+ `Promise`\<`void`\>
1802
+
1803
+ #### Defined in
1804
+
1805
+ [packages/fs/src/ensure/ensure-dir.ts:12](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/ensure/ensure-dir.ts#L12)
1806
+
1807
+ ***
1808
+
1809
+ ### ensureDirSync()
1810
+
1811
+ ```ts
1812
+ function ensureDirSync(directory): void
1813
+ ```
1814
+
1815
+ Ensures that the directory exists.
1816
+ If the directory structure does not exist, it is created. Like mkdir -p.
1817
+
1818
+ #### Parameters
1819
+
1820
+ • **directory**: `string` \| `URL`
1821
+
1822
+ #### Returns
1823
+
1824
+ `void`
1825
+
1826
+ #### Defined in
1827
+
1828
+ [packages/fs/src/ensure/ensure-dir-sync.ts:12](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/ensure/ensure-dir-sync.ts#L12)
1829
+
1830
+ ***
1831
+
1832
+ ### ensureFile()
1833
+
1834
+ ```ts
1835
+ function ensureFile(filePath): Promise<void>
1836
+ ```
1837
+
1838
+ Ensures that the file exists.
1839
+ If the file that is requested to be created is in directories that do not exist,
1840
+ these directories are created. If the file already exists, it is NOTMODIFIED.
1841
+
1842
+ #### Parameters
1843
+
1844
+ • **filePath**: `string` \| `URL`
1845
+
1846
+ #### Returns
1847
+
1848
+ `Promise`\<`void`\>
1849
+
1850
+ #### Defined in
1851
+
1852
+ [packages/fs/src/ensure/ensure-file.ts:16](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/ensure/ensure-file.ts#L16)
1853
+
1854
+ ***
1855
+
1856
+ ### ensureFileSync()
1857
+
1858
+ ```ts
1859
+ function ensureFileSync(filePath): void
1860
+ ```
1861
+
1862
+ Ensures that the file exists.
1863
+ If the file that is requested to be created is in directories that do not exist,
1864
+ these directories are created. If the file already exists, it is NOTMODIFIED.
1865
+
1866
+ #### Parameters
1867
+
1868
+ • **filePath**: `string` \| `URL`
1869
+
1870
+ #### Returns
1871
+
1872
+ `void`
1873
+
1874
+ #### Defined in
1875
+
1876
+ [packages/fs/src/ensure/ensure-file-sync.ts:16](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/ensure/ensure-file-sync.ts#L16)
1877
+
1878
+ ***
1879
+
1880
+ ### ensureLink()
1881
+
1882
+ ```ts
1883
+ function ensureLink(source, destination): Promise<void>
1884
+ ```
1885
+
1886
+ Ensures that the hard link exists.
1887
+ If the directory structure does not exist, it is created.
1888
+
1889
+ #### Parameters
1890
+
1891
+ • **source**: `string` \| `URL`
1892
+
1893
+ • **destination**: `string` \| `URL`
1894
+
1895
+ #### Returns
1896
+
1897
+ `Promise`\<`void`\>
1898
+
1899
+ #### Defined in
1900
+
1901
+ [packages/fs/src/ensure/ensure-link.ts:15](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/ensure/ensure-link.ts#L15)
1902
+
1903
+ ***
1904
+
1905
+ ### ensureLinkSync()
1906
+
1907
+ ```ts
1908
+ function ensureLinkSync(source, destination): void
1909
+ ```
1910
+
1911
+ Ensures that the hard link exists.
1912
+ If the directory structure does not exist, it is created.
1913
+
1914
+ #### Parameters
1915
+
1916
+ • **source**: `string` \| `URL`
1917
+
1918
+ • **destination**: `string` \| `URL`
1919
+
1920
+ #### Returns
1921
+
1922
+ `void`
1923
+
1924
+ #### Defined in
1925
+
1926
+ [packages/fs/src/ensure/ensure-link-sync.ts:15](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/ensure/ensure-link-sync.ts#L15)
1927
+
1928
+ ***
1929
+
1930
+ ### ensureSymlink()
1931
+
1932
+ ```ts
1933
+ function ensureSymlink(
1934
+ target,
1935
+ linkName,
1936
+ type?): Promise<void>
1937
+ ```
1938
+
1939
+ Ensures that the link exists, and points to a valid file.
1940
+ If the directory structure does not exist, it is created.
1941
+ If the link already exists, it is not modified but error is thrown if it is not point to the given target.
1942
+
1943
+ #### Parameters
1944
+
1945
+ • **target**: `string` \| `URL`
1946
+
1947
+ the source file path
1948
+
1949
+ • **linkName**: `string` \| `URL`
1950
+
1951
+ the destination link path
1952
+
1953
+ • **type?**: `Type`
1954
+
1955
+ the type of the symlink, or null to use automatic detection
1956
+
1957
+ #### Returns
1958
+
1959
+ `Promise`\<`void`\>
1960
+
1961
+ A void promise that resolves once the link exists.
1962
+
1963
+ #### Defined in
1964
+
1965
+ [packages/fs/src/ensure/ensure-symlink.ts:28](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/ensure/ensure-symlink.ts#L28)
1966
+
1967
+ ***
1968
+
1969
+ ### ensureSymlinkSync()
1970
+
1971
+ ```ts
1972
+ function ensureSymlinkSync(
1973
+ target,
1974
+ linkName,
1975
+ type?): void
1976
+ ```
1977
+
1978
+ Ensures that the link exists, and points to a valid file.
1979
+ If the directory structure does not exist, it is created.
1980
+ If the link already exists, it is not modified but error is thrown if it is not point to the given target.
1981
+
1982
+ #### Parameters
1983
+
1984
+ • **target**: `string` \| `URL`
1985
+
1986
+ the source file path
1987
+
1988
+ • **linkName**: `string` \| `URL`
1989
+
1990
+ the destination link path
1991
+
1992
+ • **type?**: `Type`
1993
+
1994
+ the type of the symlink, or null to use automatic detection
1995
+
1996
+ #### Returns
1997
+
1998
+ `void`
1999
+
2000
+ A void.
2001
+
2002
+ #### Defined in
2003
+
2004
+ [packages/fs/src/ensure/ensure-symlink-sync.ts:28](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/ensure/ensure-symlink-sync.ts#L28)
2005
+
2006
+ ***
2007
+
2008
+ ### findUp()
2009
+
2010
+ ```ts
2011
+ function findUp(name, options): Promise<string>
2012
+ ```
2013
+
2014
+ #### Parameters
2015
+
2016
+ • **name**: [`FindUpName`](index.md#findupname)
2017
+
2018
+ • **options**: [`FindUpOptions`](index.md#findupoptions) = `{}`
2019
+
2020
+ #### Returns
2021
+
2022
+ `Promise`\<`string`\>
2023
+
2024
+ #### Defined in
2025
+
2026
+ [packages/fs/src/find/find-up.ts:11](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/find/find-up.ts#L11)
2027
+
2028
+ ***
2029
+
2030
+ ### findUpSync()
2031
+
2032
+ ```ts
2033
+ function findUpSync(name, options): string
2034
+ ```
2035
+
2036
+ #### Parameters
2037
+
2038
+ • **name**: [`FindUpNameSync`](index.md#findupnamesync)
2039
+
2040
+ • **options**: [`FindUpOptions`](index.md#findupoptions) = `{}`
2041
+
2042
+ #### Returns
2043
+
2044
+ `string`
2045
+
2046
+ #### Defined in
2047
+
2048
+ [packages/fs/src/find/find-up-sync.ts:11](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/find/find-up-sync.ts#L11)
2049
+
2050
+ ***
2051
+
2052
+ ### format()
2053
+
2054
+ ```ts
2055
+ function format(content, eol): string
2056
+ ```
2057
+
2058
+ Format the file to the targeted EOL.
2059
+
2060
+ #### Parameters
2061
+
2062
+ • **content**: `string`
2063
+
2064
+ • **eol**: "\n" \| "\r\n"
2065
+
2066
+ #### Returns
2067
+
2068
+ `string`
2069
+
2070
+ #### Defined in
2071
+
2072
+ [packages/fs/src/eol.ts:36](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/eol.ts#L36)
2073
+
2074
+ ***
2075
+
2076
+ ### isAccessible()
2077
+
2078
+ ```ts
2079
+ function isAccessible(path, mode?): Promise<boolean>
2080
+ ```
2081
+
2082
+ Returns a Promise that resolves to a boolean indicating if the path is accessible or not.
2083
+
2084
+ #### Parameters
2085
+
2086
+ • **path**: `string` \| `URL`
2087
+
2088
+ • **mode?**: `number`
2089
+
2090
+ #### Returns
2091
+
2092
+ `Promise`\<`boolean`\>
2093
+
2094
+ #### Defined in
2095
+
2096
+ [packages/fs/src/is-accessible.ts:9](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/is-accessible.ts#L9)
2097
+
2098
+ ***
2099
+
2100
+ ### isAccessibleSync()
2101
+
2102
+ ```ts
2103
+ function isAccessibleSync(path, mode?): boolean
2104
+ ```
2105
+
2106
+ Returns a boolean indicating if the path is accessible or not.
2107
+
2108
+ #### Parameters
2109
+
2110
+ • **path**: `string` \| `URL`
2111
+
2112
+ • **mode?**: `number`
2113
+
2114
+ #### Returns
2115
+
2116
+ `boolean`
2117
+
2118
+ #### Defined in
2119
+
2120
+ [packages/fs/src/is-accessible-sync.ts:9](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/is-accessible-sync.ts#L9)
2121
+
2122
+ ***
2123
+
2124
+ ### move()
2125
+
2126
+ ```ts
2127
+ function move(
2128
+ sourcePath,
2129
+ destinationPath,
2130
+ options): Promise<void>
2131
+ ```
2132
+
2133
+ Move a file asynchronously.
2134
+
2135
+ #### Parameters
2136
+
2137
+ • **sourcePath**: `string`
2138
+
2139
+ The file you want to move.
2140
+
2141
+ • **destinationPath**: `string`
2142
+
2143
+ Where you want the file moved.
2144
+
2145
+ • **options**: [`MoveOptions`](index.md#moveoptions) = `{}`
2146
+
2147
+ Configuration options.
2148
+
2149
+ #### Returns
2150
+
2151
+ `Promise`\<`void`\>
2152
+
2153
+ A `Promise` that resolves when the file has been moved.
2154
+
2155
+ #### Example
2156
+
2157
+ ```
2158
+ import { moveFile } from '@visulima/fs';
2159
+
2160
+ await moveFile('source/test.png', 'destination/test.png');
2161
+ console.log('The file has been moved');
2162
+ ```
2163
+
2164
+ #### Defined in
2165
+
2166
+ [packages/fs/src/move/index.ts:35](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/move/index.ts#L35)
2167
+
2168
+ ***
2169
+
2170
+ ### moveSync()
2171
+
2172
+ ```ts
2173
+ function moveSync(
2174
+ sourcePath,
2175
+ destinationPath,
2176
+ options?): void
2177
+ ```
2178
+
2179
+ Move a file synchronously.
2180
+
2181
+ #### Parameters
2182
+
2183
+ • **sourcePath**: `string`
2184
+
2185
+ The file you want to move.
2186
+
2187
+ • **destinationPath**: `string`
2188
+
2189
+ Where you want the file moved.
2190
+
2191
+ • **options?**: [`MoveOptions`](index.md#moveoptions)
2192
+
2193
+ Configuration options.
2194
+
2195
+ #### Returns
2196
+
2197
+ `void`
2198
+
2199
+ Nothing is returned.
2200
+
2201
+ #### Example
2202
+
2203
+ ```
2204
+ import { moveFileSync } from '@visulima/fs';
2205
+
2206
+ moveFileSync('source/test.png', 'destination/test.png');
2207
+ console.log('The file has been moved');
2208
+ ```
2209
+
2210
+ #### Defined in
2211
+
2212
+ [packages/fs/src/move/index.ts:61](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/move/index.ts#L61)
2213
+
2214
+ ***
2215
+
2216
+ ### readFile()
2217
+
2218
+ ```ts
2219
+ function readFile<O>(path, options?): Promise<ContentType<O>>
2220
+ ```
2221
+
2222
+ #### Type Parameters
2223
+
2224
+ • **O** *extends* [`ReadFileOptions`](index.md#readfileoptionsc)\<`"brotli"` \| `"gzip"` \| `"none"`\> = `undefined`
2225
+
2226
+ #### Parameters
2227
+
2228
+ • **path**: `string` \| `URL`
2229
+
2230
+ • **options?**: `O`
2231
+
2232
+ #### Returns
2233
+
2234
+ `Promise`\<`ContentType`\<`O`\>\>
2235
+
2236
+ #### Defined in
2237
+
2238
+ [packages/fs/src/read/read-file.ts:20](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/read/read-file.ts#L20)
2239
+
2240
+ ***
2241
+
2242
+ ### readFileSync()
2243
+
2244
+ ```ts
2245
+ function readFileSync<O>(path, options?): ContentType<O>
2246
+ ```
2247
+
2248
+ #### Type Parameters
2249
+
2250
+ • **O** *extends* [`ReadFileOptions`](index.md#readfileoptionsc)\<`"brotli"` \| `"gzip"` \| `"none"`\> = `undefined`
2251
+
2252
+ #### Parameters
2253
+
2254
+ • **path**: `string` \| `URL`
2255
+
2256
+ • **options?**: `O`
2257
+
2258
+ #### Returns
2259
+
2260
+ `ContentType`\<`O`\>
2261
+
2262
+ #### Defined in
2263
+
2264
+ [packages/fs/src/read/read-file-sync.ts:18](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/read/read-file-sync.ts#L18)
2265
+
2266
+ ***
2267
+
2268
+ ### readJson()
2269
+
2270
+ #### readJson(path, options)
2271
+
2272
+ ```ts
2273
+ function readJson<T>(path, options?): Promise<T>
2274
+ ```
2275
+
2276
+ ##### Type Parameters
2277
+
2278
+ • **T** *extends* `JsonValue`
2279
+
2280
+ ##### Parameters
2281
+
2282
+ • **path**: `string` \| `URL`
2283
+
2284
+ • **options?**: [`ReadJsonOptions`](index.md#readjsonoptions)
2285
+
2286
+ ##### Returns
2287
+
2288
+ `Promise`\<`T`\>
2289
+
2290
+ ##### Defined in
2291
+
2292
+ [packages/fs/src/read/read-json.ts:8](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/read/read-json.ts#L8)
2293
+
2294
+ #### readJson(path, reviver, options)
2295
+
2296
+ ```ts
2297
+ function readJson<T>(
2298
+ path,
2299
+ reviver,
2300
+ options?): Promise<T>
2301
+ ```
2302
+
2303
+ ##### Type Parameters
2304
+
2305
+ • **T** *extends* `JsonValue`
2306
+
2307
+ ##### Parameters
2308
+
2309
+ • **path**: `string` \| `URL`
2310
+
2311
+ • **reviver**
2312
+
2313
+ • **options?**: [`ReadJsonOptions`](index.md#readjsonoptions)
2314
+
2315
+ ##### Returns
2316
+
2317
+ `Promise`\<`T`\>
2318
+
2319
+ ##### Defined in
2320
+
2321
+ [packages/fs/src/read/read-json.ts:10](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/read/read-json.ts#L10)
2322
+
2323
+ ***
2324
+
2325
+ ### readJsonSync()
2326
+
2327
+ #### readJsonSync(path, options)
2328
+
2329
+ ```ts
2330
+ function readJsonSync<T>(path, options?): T
2331
+ ```
2332
+
2333
+ ##### Type Parameters
2334
+
2335
+ • **T** *extends* `JsonValue`
2336
+
2337
+ ##### Parameters
2338
+
2339
+ • **path**: `string` \| `URL`
2340
+
2341
+ • **options?**: [`ReadJsonOptions`](index.md#readjsonoptions)
2342
+
2343
+ ##### Returns
2344
+
2345
+ `T`
2346
+
2347
+ ##### Defined in
2348
+
2349
+ [packages/fs/src/read/read-json-sync.ts:8](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/read/read-json-sync.ts#L8)
2350
+
2351
+ #### readJsonSync(path, reviver, options)
2352
+
2353
+ ```ts
2354
+ function readJsonSync<T>(
2355
+ path,
2356
+ reviver,
2357
+ options?): T
2358
+ ```
2359
+
2360
+ ##### Type Parameters
2361
+
2362
+ • **T** *extends* `JsonValue`
2363
+
2364
+ ##### Parameters
2365
+
2366
+ • **path**: `string` \| `URL`
2367
+
2368
+ • **reviver**
2369
+
2370
+ • **options?**: [`ReadJsonOptions`](index.md#readjsonoptions)
2371
+
2372
+ ##### Returns
2373
+
2374
+ `T`
2375
+
2376
+ ##### Defined in
2377
+
2378
+ [packages/fs/src/read/read-json-sync.ts:10](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/read/read-json-sync.ts#L10)
2379
+
2380
+ ***
2381
+
2382
+ ### readYaml()
2383
+
2384
+ #### readYaml(path, options)
2385
+
2386
+ ```ts
2387
+ function readYaml<R>(path, options?): Promise<R>
2388
+ ```
2389
+
2390
+ ##### Type Parameters
2391
+
2392
+ • **R** = `Record`\<`string`, `unknown`\>
2393
+
2394
+ ##### Parameters
2395
+
2396
+ • **path**: `string` \| `URL`
2397
+
2398
+ • **options?**: `ReadYamlOptions`\<`"brotli"` \| `"gzip"` \| `"none"`\>
2399
+
2400
+ ##### Returns
2401
+
2402
+ `Promise`\<`R`\>
2403
+
2404
+ ##### Defined in
2405
+
2406
+ [packages/fs/src/read/read-yaml.ts:6](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/read/read-yaml.ts#L6)
2407
+
2408
+ #### readYaml(path, reviver, options)
2409
+
2410
+ ```ts
2411
+ function readYaml<R>(
2412
+ path,
2413
+ reviver?,
2414
+ options?): Promise<R>
2415
+ ```
2416
+
2417
+ ##### Type Parameters
2418
+
2419
+ • **R** = `Record`\<`string`, `unknown`\>
2420
+
2421
+ ##### Parameters
2422
+
2423
+ • **path**: `string` \| `URL`
2424
+
2425
+ • **reviver?**: `YamlReviver`
2426
+
2427
+ • **options?**: `ReadYamlOptions`\<`"brotli"` \| `"gzip"` \| `"none"`\>
2428
+
2429
+ ##### Returns
2430
+
2431
+ `Promise`\<`R`\>
2432
+
2433
+ ##### Defined in
2434
+
2435
+ [packages/fs/src/read/read-yaml.ts:7](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/read/read-yaml.ts#L7)
2436
+
2437
+ ***
2438
+
2439
+ ### readYamlSync()
2440
+
2441
+ #### readYamlSync(path, options)
2442
+
2443
+ ```ts
2444
+ function readYamlSync<R>(path, options?): R
2445
+ ```
2446
+
2447
+ ##### Type Parameters
2448
+
2449
+ • **R** = `Record`\<`string`, `unknown`\>
2450
+
2451
+ ##### Parameters
2452
+
2453
+ • **path**: `string` \| `URL`
2454
+
2455
+ • **options?**: `ReadYamlOptions`\<`"brotli"` \| `"gzip"` \| `"none"`\>
2456
+
2457
+ ##### Returns
2458
+
2459
+ `R`
2460
+
2461
+ ##### Defined in
2462
+
2463
+ [packages/fs/src/read/read-yaml-sync.ts:6](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/read/read-yaml-sync.ts#L6)
2464
+
2465
+ #### readYamlSync(path, reviver, options)
2466
+
2467
+ ```ts
2468
+ function readYamlSync<R>(
2469
+ path,
2470
+ reviver?,
2471
+ options?): R
2472
+ ```
2473
+
2474
+ ##### Type Parameters
2475
+
2476
+ • **R** = `Record`\<`string`, `unknown`\>
2477
+
2478
+ ##### Parameters
2479
+
2480
+ • **path**: `string` \| `URL`
2481
+
2482
+ • **reviver?**: `YamlReviver`
2483
+
2484
+ • **options?**: `ReadYamlOptions`\<`"brotli"` \| `"gzip"` \| `"none"`\>
2485
+
2486
+ ##### Returns
2487
+
2488
+ `R`
2489
+
2490
+ ##### Defined in
2491
+
2492
+ [packages/fs/src/read/read-yaml-sync.ts:7](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/read/read-yaml-sync.ts#L7)
2493
+
2494
+ ***
2495
+
2496
+ ### remove()
2497
+
2498
+ ```ts
2499
+ function remove(path, options): Promise<void>
2500
+ ```
2501
+
2502
+ #### Parameters
2503
+
2504
+ • **path**: `string` \| `URL`
2505
+
2506
+ • **options** = `{}`
2507
+
2508
+ • **options.maxRetries?**: `number`
2509
+
2510
+ If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
2511
+ `EPERM` error is encountered, Node.js will retry the operation with a linear
2512
+ backoff wait of `retryDelay` ms longer on each try. This option represents the
2513
+ number of retries. This option is ignored if the `recursive` option is not
2514
+ `true`.
2515
+
2516
+ **Default**
2517
+
2518
+ ```ts
2519
+ 0
2520
+ ```
2521
+
2522
+ • **options.retryDelay?**: `number`
2523
+
2524
+ The amount of time in milliseconds to wait between retries.
2525
+ This option is ignored if the `recursive` option is not `true`.
2526
+
2527
+ **Default**
2528
+
2529
+ ```ts
2530
+ 100
2531
+ ```
2532
+
2533
+ #### Returns
2534
+
2535
+ `Promise`\<`void`\>
2536
+
2537
+ #### Defined in
2538
+
2539
+ [packages/fs/src/remove/remove.ts:5](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/remove/remove.ts#L5)
2540
+
2541
+ ***
2542
+
2543
+ ### removeSync()
2544
+
2545
+ ```ts
2546
+ function removeSync(path, options): void
2547
+ ```
2548
+
2549
+ #### Parameters
2550
+
2551
+ • **path**: `string` \| `URL`
2552
+
2553
+ • **options** = `{}`
2554
+
2555
+ • **options.maxRetries?**: `number`
2556
+
2557
+ If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
2558
+ `EPERM` error is encountered, Node.js will retry the operation with a linear
2559
+ backoff wait of `retryDelay` ms longer on each try. This option represents the
2560
+ number of retries. This option is ignored if the `recursive` option is not
2561
+ `true`.
2562
+
2563
+ **Default**
2564
+
2565
+ ```ts
2566
+ 0
2567
+ ```
2568
+
2569
+ • **options.retryDelay?**: `number`
2570
+
2571
+ The amount of time in milliseconds to wait between retries.
2572
+ This option is ignored if the `recursive` option is not `true`.
2573
+
2574
+ **Default**
2575
+
2576
+ ```ts
2577
+ 100
2578
+ ```
2579
+
2580
+ #### Returns
2581
+
2582
+ `void`
2583
+
2584
+ #### Defined in
2585
+
2586
+ [packages/fs/src/remove/remove-sync.ts:5](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/remove/remove-sync.ts#L5)
2587
+
2588
+ ***
2589
+
2590
+ ### rename()
2591
+
2592
+ ```ts
2593
+ function rename(
2594
+ source,
2595
+ destination,
2596
+ options?): Promise<void>
2597
+ ```
2598
+
2599
+ Rename a file asynchronously.
2600
+
2601
+ #### Parameters
2602
+
2603
+ • **source**: `string`
2604
+
2605
+ The file you want to rename.
2606
+
2607
+ • **destination**: `string`
2608
+
2609
+ The name of the renamed file.
2610
+
2611
+ • **options?**: [`MoveOptions`](index.md#moveoptions)
2612
+
2613
+ Configuration options.
2614
+
2615
+ #### Returns
2616
+
2617
+ `Promise`\<`void`\>
2618
+
2619
+ A `Promise` that resolves when the file has been renamed.
2620
+
2621
+ #### Example
2622
+
2623
+ ```
2624
+ import { renameFile } from '@visulima/fs';
2625
+
2626
+ await renameFile('test.png', 'tests.png', {cwd: 'source'});
2627
+ console.log('The file has been renamed');
2628
+ ```
2629
+
2630
+ #### Defined in
2631
+
2632
+ [packages/fs/src/move/index.ts:85](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/move/index.ts#L85)
2633
+
2634
+ ***
2635
+
2636
+ ### renameSync()
2637
+
2638
+ ```ts
2639
+ function renameSync(
2640
+ source,
2641
+ destination,
2642
+ options?): void
2643
+ ```
2644
+
2645
+ Rename a file synchronously.
2646
+
2647
+ #### Parameters
2648
+
2649
+ • **source**: `string`
2650
+
2651
+ The file you want to rename.
2652
+
2653
+ • **destination**: `string`
2654
+
2655
+ The name of the renamed file.
2656
+
2657
+ • **options?**: [`MoveOptions`](index.md#moveoptions)
2658
+
2659
+ Configuration options.
2660
+
2661
+ #### Returns
2662
+
2663
+ `void`
2664
+
2665
+ A `Promise` that resolves when the file has been renamed.
2666
+
2667
+ #### Example
2668
+
2669
+ ```
2670
+ import {renameFileSync} from '@visulima/fs';
2671
+
2672
+ renameFileSync('test.png', 'tests.png', {cwd: 'source'});
2673
+ console.log('The file has been renamed');
2674
+ ```
2675
+
2676
+ #### Defined in
2677
+
2678
+ [packages/fs/src/move/index.ts:109](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/move/index.ts#L109)
2679
+
2680
+ ***
2681
+
2682
+ ### walk()
2683
+
2684
+ ```ts
2685
+ function walk(directory, __namedParameters): AsyncIterableIterator<WalkEntry>
2686
+ ```
2687
+
2688
+ Walks the file tree rooted at root, yielding each file or directory in the
2689
+ tree filtered according to the given options.
2690
+ Options:
2691
+ - maxDepth?: number = Infinity;
2692
+ - includeFiles?: boolean = true;
2693
+ - includeDirs?: boolean = true;
2694
+ - includeSymlinks?: boolean = true;
2695
+ - followSymlinks?: boolean = false;
2696
+ - extensions?: string[];
2697
+ - match?: string | ReadonlyArray<string>;
2698
+ - skip?: string | ReadonlyArray<string>;
2699
+
2700
+ #### Parameters
2701
+
2702
+ • **directory**: `string` \| `URL`
2703
+
2704
+ • **\_\_namedParameters**: [`WalkOptions`](index.md#walkoptions) = `{}`
2705
+
2706
+ #### Returns
2707
+
2708
+ `AsyncIterableIterator`\<[`WalkEntry`](index.md#walkentry)\>
2709
+
2710
+ #### Defined in
2711
+
2712
+ [packages/fs/src/find/walk.ts:52](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/find/walk.ts#L52)
2713
+
2714
+ ***
2715
+
2716
+ ### walkSync()
2717
+
2718
+ ```ts
2719
+ function walkSync(directory, __namedParameters): IterableIterator<WalkEntry>
2720
+ ```
2721
+
2722
+ Same as [`walk`](index.md#walk) but uses synchronous ops
2723
+
2724
+ #### Parameters
2725
+
2726
+ • **directory**: `string` \| `URL`
2727
+
2728
+ • **\_\_namedParameters**: [`WalkOptions`](index.md#walkoptions) = `{}`
2729
+
2730
+ #### Returns
2731
+
2732
+ `IterableIterator`\<[`WalkEntry`](index.md#walkentry)\>
2733
+
2734
+ #### Defined in
2735
+
2736
+ [packages/fs/src/find/walk-sync.ts:40](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/find/walk-sync.ts#L40)
2737
+
2738
+ ***
2739
+
2740
+ ### writeFile()
2741
+
2742
+ ```ts
2743
+ function writeFile(
2744
+ path,
2745
+ content,
2746
+ options?): Promise<void>
2747
+ ```
2748
+
2749
+ #### Parameters
2750
+
2751
+ • **path**: `string` \| `URL`
2752
+
2753
+ • **content**: `string` \| `ArrayBuffer` \| `ArrayBufferView`
2754
+
2755
+ • **options?**: [`WriteFileOptions`](index.md#writefileoptions)
2756
+
2757
+ #### Returns
2758
+
2759
+ `Promise`\<`void`\>
2760
+
2761
+ #### Defined in
2762
+
2763
+ [packages/fs/src/write/write-file.ts:15](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/write/write-file.ts#L15)
2764
+
2765
+ ***
2766
+
2767
+ ### writeFileSync()
2768
+
2769
+ ```ts
2770
+ function writeFileSync(
2771
+ path,
2772
+ content,
2773
+ options?): void
2774
+ ```
2775
+
2776
+ #### Parameters
2777
+
2778
+ • **path**: `string` \| `URL`
2779
+
2780
+ • **content**: `string` \| `ArrayBuffer` \| `ArrayBufferView`
2781
+
2782
+ • **options?**: [`WriteFileOptions`](index.md#writefileoptions)
2783
+
2784
+ #### Returns
2785
+
2786
+ `void`
2787
+
2788
+ #### Defined in
2789
+
2790
+ [packages/fs/src/write/write-file-sync.ts:15](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/write/write-file-sync.ts#L15)
2791
+
2792
+ ***
2793
+
2794
+ ### writeJson()
2795
+
2796
+ ```ts
2797
+ function writeJson(
2798
+ path,
2799
+ data,
2800
+ options): Promise<void>
2801
+ ```
2802
+
2803
+ #### Parameters
2804
+
2805
+ • **path**: `string` \| `URL`
2806
+
2807
+ • **data**: `unknown`
2808
+
2809
+ • **options**: [`WriteJsonOptions`](index.md#writejsonoptions) = `{}`
2810
+
2811
+ #### Returns
2812
+
2813
+ `Promise`\<`void`\>
2814
+
2815
+ #### Defined in
2816
+
2817
+ [packages/fs/src/write/write-json.ts:11](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/write/write-json.ts#L11)
2818
+
2819
+ ***
2820
+
2821
+ ### writeJsonSync()
2822
+
2823
+ ```ts
2824
+ function writeJsonSync(
2825
+ path,
2826
+ data,
2827
+ options): void
2828
+ ```
2829
+
2830
+ #### Parameters
2831
+
2832
+ • **path**: `string` \| `URL`
2833
+
2834
+ • **data**: `unknown`
2835
+
2836
+ • **options**: [`WriteJsonOptions`](index.md#writejsonoptions) = `{}`
2837
+
2838
+ #### Returns
2839
+
2840
+ `void`
2841
+
2842
+ #### Defined in
2843
+
2844
+ [packages/fs/src/write/write-json-sync.ts:11](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/write/write-json-sync.ts#L11)
2845
+
2846
+ ***
2847
+
2848
+ ### writeYaml()
2849
+
2850
+ #### writeYaml(path, data, options)
2851
+
2852
+ ```ts
2853
+ function writeYaml(
2854
+ path,
2855
+ data,
2856
+ options?): Promise<void>
2857
+ ```
2858
+
2859
+ ##### Parameters
2860
+
2861
+ • **path**: `string` \| `URL`
2862
+
2863
+ • **data**: `any`
2864
+
2865
+ • **options?**: `Options`
2866
+
2867
+ ##### Returns
2868
+
2869
+ `Promise`\<`void`\>
2870
+
2871
+ ##### Defined in
2872
+
2873
+ [packages/fs/src/write/write-yaml.ts:10](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/write/write-yaml.ts#L10)
2874
+
2875
+ #### writeYaml(path, data, replacer, options)
2876
+
2877
+ ```ts
2878
+ function writeYaml(
2879
+ path,
2880
+ data,
2881
+ replacer?,
2882
+ options?): Promise<void>
2883
+ ```
2884
+
2885
+ ##### Parameters
2886
+
2887
+ • **path**: `string` \| `URL`
2888
+
2889
+ • **data**: `any`
2890
+
2891
+ • **replacer?**: [`JsonReplacer`](index.md#jsonreplacer)
2892
+
2893
+ • **options?**: `string` \| `number` \| `Options`
2894
+
2895
+ ##### Returns
2896
+
2897
+ `Promise`\<`void`\>
2898
+
2899
+ ##### Defined in
2900
+
2901
+ [packages/fs/src/write/write-yaml.ts:16](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/write/write-yaml.ts#L16)
2902
+
2903
+ ***
2904
+
2905
+ ### writeYamlSync()
2906
+
2907
+ #### writeYamlSync(path, data, options)
2908
+
2909
+ ```ts
2910
+ function writeYamlSync(
2911
+ path,
2912
+ data,
2913
+ options?): void
2914
+ ```
2915
+
2916
+ ##### Parameters
2917
+
2918
+ • **path**: `string` \| `URL`
2919
+
2920
+ • **data**: `any`
2921
+
2922
+ • **options?**: `Options`
2923
+
2924
+ ##### Returns
2925
+
2926
+ `void`
2927
+
2928
+ ##### Defined in
2929
+
2930
+ [packages/fs/src/write/write-yaml-sync.ts:10](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/write/write-yaml-sync.ts#L10)
2931
+
2932
+ #### writeYamlSync(path, data, replacer, options)
2933
+
2934
+ ```ts
2935
+ function writeYamlSync(
2936
+ path,
2937
+ data,
2938
+ replacer?,
2939
+ options?): void
2940
+ ```
2941
+
2942
+ ##### Parameters
2943
+
2944
+ • **path**: `string` \| `URL`
2945
+
2946
+ • **data**: `any`
2947
+
2948
+ • **replacer?**: [`JsonReplacer`](index.md#jsonreplacer)
2949
+
2950
+ • **options?**: `string` \| `number` \| `Options`
2951
+
2952
+ ##### Returns
2953
+
2954
+ `void`
2955
+
2956
+ ##### Defined in
2957
+
2958
+ [packages/fs/src/write/write-yaml-sync.ts:16](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/write/write-yaml-sync.ts#L16)
2959
+
2960
+ ## Variables
2961
+
2962
+ ### CRLF
2963
+
2964
+ ```ts
2965
+ const CRLF: "\r\n";
2966
+ ```
2967
+
2968
+ End-of-line character for Windows platforms.
2969
+
2970
+ #### Defined in
2971
+
2972
+ [packages/fs/src/eol.ts:9](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/eol.ts#L9)
2973
+
2974
+ ***
2975
+
2976
+ ### EOL
2977
+
2978
+ ```ts
2979
+ const EOL: "\n" | "\r\n";
2980
+ ```
2981
+
2982
+ End-of-line character evaluated for the current platform.
2983
+
2984
+ #### Defined in
2985
+
2986
+ [packages/fs/src/eol.ts:14](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/eol.ts#L14)
2987
+
2988
+ ***
2989
+
2990
+ ### F\_OK
2991
+
2992
+ ```ts
2993
+ const F_OK: 0 = 0;
2994
+ ```
2995
+
2996
+ Is the path visible to the calling process?
2997
+
2998
+ #### Defined in
2999
+
3000
+ [packages/fs/src/constants.ts:2](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/constants.ts#L2)
3001
+
3002
+ ***
3003
+
3004
+ ### FIND\_UP\_STOP
3005
+
3006
+ ```ts
3007
+ const FIND_UP_STOP: typeof FIND_UP_STOP;
3008
+ ```
3009
+
3010
+ #### Defined in
3011
+
3012
+ [packages/fs/src/constants.ts:13](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/constants.ts#L13)
3013
+
3014
+ ***
3015
+
3016
+ ### LF
3017
+
3018
+ ```ts
3019
+ const LF: "\n";
3020
+ ```
3021
+
3022
+ End-of-line character for POSIX platforms such as macOS and Linux.
3023
+
3024
+ #### Defined in
3025
+
3026
+ [packages/fs/src/eol.ts:6](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/eol.ts#L6)
3027
+
3028
+ ***
3029
+
3030
+ ### R\_OK
3031
+
3032
+ ```ts
3033
+ const R_OK: 4 = 4;
3034
+ ```
3035
+
3036
+ Is the path readable to the calling process?
3037
+
3038
+ #### Defined in
3039
+
3040
+ [packages/fs/src/constants.ts:5](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/constants.ts#L5)
3041
+
3042
+ ***
3043
+
3044
+ ### W\_OK
3045
+
3046
+ ```ts
3047
+ const W_OK: 2 = 2;
3048
+ ```
3049
+
3050
+ Is the path writable to the calling process?
3051
+
3052
+ #### Defined in
3053
+
3054
+ [packages/fs/src/constants.ts:8](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/constants.ts#L8)
3055
+
3056
+ ***
3057
+
3058
+ ### X\_OK
3059
+
3060
+ ```ts
3061
+ const X_OK: 1 = 1;
3062
+ ```
3063
+
3064
+ Is the path executable to the calling process?
3065
+
3066
+ #### Defined in
3067
+
3068
+ [packages/fs/src/constants.ts:11](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/constants.ts#L11)
3069
+
3070
+ ## Interfaces
3071
+
3072
+ ### WalkEntry
3073
+
3074
+ #### Extends
3075
+
3076
+ - `Pick`\<`Dirent`, `"isDirectory"` \| `"isFile"` \| `"isSymbolicLink"` \| `"name"`\>
3077
+
3078
+ #### Methods
3079
+
3080
+ ##### isDirectory()
3081
+
3082
+ ```ts
3083
+ isDirectory(): boolean
3084
+ ```
3085
+
3086
+ Returns `true` if the `fs.Dirent` object describes a file system
3087
+ directory.
3088
+
3089
+ ###### Returns
3090
+
3091
+ `boolean`
3092
+
3093
+ ###### Since
3094
+
3095
+ v10.10.0
3096
+
3097
+ ###### Inherited from
3098
+
3099
+ `Pick.isDirectory`
3100
+
3101
+ ###### Defined in
3102
+
3103
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/fs.d.ts:190
3104
+
3105
+ ##### isFile()
3106
+
3107
+ ```ts
3108
+ isFile(): boolean
3109
+ ```
3110
+
3111
+ Returns `true` if the `fs.Dirent` object describes a regular file.
3112
+
3113
+ ###### Returns
3114
+
3115
+ `boolean`
3116
+
3117
+ ###### Since
3118
+
3119
+ v10.10.0
3120
+
3121
+ ###### Inherited from
3122
+
3123
+ `Pick.isFile`
3124
+
3125
+ ###### Defined in
3126
+
3127
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/fs.d.ts:184
3128
+
3129
+ ##### isSymbolicLink()
3130
+
3131
+ ```ts
3132
+ isSymbolicLink(): boolean
3133
+ ```
3134
+
3135
+ Returns `true` if the `fs.Dirent` object describes a symbolic link.
3136
+
3137
+ ###### Returns
3138
+
3139
+ `boolean`
3140
+
3141
+ ###### Since
3142
+
3143
+ v10.10.0
3144
+
3145
+ ###### Inherited from
3146
+
3147
+ `Pick.isSymbolicLink`
3148
+
3149
+ ###### Defined in
3150
+
3151
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/fs.d.ts:205
3152
+
3153
+ #### Properties
3154
+
3155
+ ##### name
3156
+
3157
+ ```ts
3158
+ name: string;
3159
+ ```
3160
+
3161
+ The file name that this `fs.Dirent` object refers to. The type of this
3162
+ value is determined by the `options.encoding` passed to readdir or readdirSync.
3163
+
3164
+ ###### Since
3165
+
3166
+ v10.10.0
3167
+
3168
+ ###### Inherited from
3169
+
3170
+ `Pick.name`
3171
+
3172
+ ###### Defined in
3173
+
3174
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/fs.d.ts:222
3175
+
3176
+ ##### path
3177
+
3178
+ ```ts
3179
+ path: string;
3180
+ ```
3181
+
3182
+ ###### Defined in
3183
+
3184
+ [packages/fs/src/types.ts:57](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L57)
3185
+
3186
+ ***
3187
+
3188
+ ### WalkOptions
3189
+
3190
+ #### Properties
3191
+
3192
+ ##### extensions?
3193
+
3194
+ ```ts
3195
+ optional extensions: string[];
3196
+ ```
3197
+
3198
+ List of file extensions used to filter entries.
3199
+ If specified, entries without the file extension specified by this option are excluded.
3200
+
3201
+ ###### Default
3202
+
3203
+ ```ts
3204
+ {undefined}
3205
+ ```
3206
+
3207
+ ###### Defined in
3208
+
3209
+ [packages/fs/src/types.ts:15](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L15)
3210
+
3211
+ ##### followSymlinks?
3212
+
3213
+ ```ts
3214
+ optional followSymlinks: boolean;
3215
+ ```
3216
+
3217
+ Indicates whether symlinks should be resolved or not.
3218
+
3219
+ ###### Default
3220
+
3221
+ ```ts
3222
+ {false}
3223
+ ```
3224
+
3225
+ ###### Defined in
3226
+
3227
+ [packages/fs/src/types.ts:20](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L20)
3228
+
3229
+ ##### includeDirs?
3230
+
3231
+ ```ts
3232
+ optional includeDirs: boolean;
3233
+ ```
3234
+
3235
+ Indicates whether directory entries should be included or not.
3236
+
3237
+ ###### Default
3238
+
3239
+ ```ts
3240
+ {true}
3241
+ ```
3242
+
3243
+ ###### Defined in
3244
+
3245
+ [packages/fs/src/types.ts:25](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L25)
3246
+
3247
+ ##### includeFiles?
3248
+
3249
+ ```ts
3250
+ optional includeFiles: boolean;
3251
+ ```
3252
+
3253
+ Indicates whether file entries should be included or not.
3254
+
3255
+ ###### Default
3256
+
3257
+ ```ts
3258
+ {true}
3259
+ ```
3260
+
3261
+ ###### Defined in
3262
+
3263
+ [packages/fs/src/types.ts:30](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L30)
3264
+
3265
+ ##### includeSymlinks?
3266
+
3267
+ ```ts
3268
+ optional includeSymlinks: boolean;
3269
+ ```
3270
+
3271
+ Indicates whether symlink entries should be included or not.
3272
+ This option is meaningful only if `followSymlinks` is set to `false`.
3273
+
3274
+ ###### Default
3275
+
3276
+ ```ts
3277
+ {true}
3278
+ ```
3279
+
3280
+ ###### Defined in
3281
+
3282
+ [packages/fs/src/types.ts:36](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L36)
3283
+
3284
+ ##### match?
3285
+
3286
+ ```ts
3287
+ optional match: (string | RegExp)[];
3288
+ ```
3289
+
3290
+ List of regular expression or glob patterns used to filter entries.
3291
+ If specified, entries that do not match the patterns specified by this option are excluded.
3292
+
3293
+ ###### Default
3294
+
3295
+ ```ts
3296
+ {undefined}
3297
+ ```
3298
+
3299
+ ###### Defined in
3300
+
3301
+ [packages/fs/src/types.ts:42](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L42)
3302
+
3303
+ ##### maxDepth?
3304
+
3305
+ ```ts
3306
+ optional maxDepth: number;
3307
+ ```
3308
+
3309
+ The maximum depth of the file tree to be walked recursively.
3310
+
3311
+ ###### Default
3312
+
3313
+ ```ts
3314
+ {Infinity}
3315
+ ```
3316
+
3317
+ ###### Defined in
3318
+
3319
+ [packages/fs/src/types.ts:47](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L47)
3320
+
3321
+ ##### skip?
3322
+
3323
+ ```ts
3324
+ optional skip: (string | RegExp)[];
3325
+ ```
3326
+
3327
+ List of regular expression or glob patterns used to filter entries.
3328
+ If specified, entries matching the patterns specified by this option are excluded.
3329
+
3330
+ ###### Default
3331
+
3332
+ ```ts
3333
+ {undefined}
3334
+ ```
3335
+
3336
+ ###### Defined in
3337
+
3338
+ [packages/fs/src/types.ts:53](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L53)
3339
+
3340
+ ## Type Aliases
3341
+
3342
+ ### CodeFrameLocation
3343
+
3344
+ ```ts
3345
+ type CodeFrameLocation: object;
3346
+ ```
3347
+
3348
+ #### Type declaration
3349
+
3350
+ ##### column?
3351
+
3352
+ ```ts
3353
+ optional column: number;
3354
+ ```
3355
+
3356
+ ##### line
3357
+
3358
+ ```ts
3359
+ line: number;
3360
+ ```
3361
+
3362
+ #### Defined in
3363
+
3364
+ [packages/fs/src/types.ts:91](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L91)
3365
+
3366
+ ***
3367
+
3368
+ ### EmptyDirOptions
3369
+
3370
+ ```ts
3371
+ type EmptyDirOptions: object;
3372
+ ```
3373
+
3374
+ #### Type declaration
3375
+
3376
+ ##### maxRetries?
3377
+
3378
+ ```ts
3379
+ optional maxRetries: number;
3380
+ ```
3381
+
3382
+ If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
3383
+ `EPERM` error is encountered, Node.js will retry the operation with a linear
3384
+ backoff wait of `retryDelay` ms longer on each try. This option represents the
3385
+ number of retries. This option is ignored if the `recursive` option is not
3386
+ `true`.
3387
+
3388
+ ###### Default
3389
+
3390
+ ```ts
3391
+ 0
3392
+ ```
3393
+
3394
+ ##### retryDelay?
3395
+
3396
+ ```ts
3397
+ optional retryDelay: number;
3398
+ ```
3399
+
3400
+ The amount of time in milliseconds to wait between retries.
3401
+ This option is ignored if the `recursive` option is not `true`.
3402
+
3403
+ ###### Default
3404
+
3405
+ ```ts
3406
+ 100
3407
+ ```
3408
+
3409
+ #### Defined in
3410
+
3411
+ [packages/fs/src/types.ts:188](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L188)
3412
+
3413
+ ***
3414
+
3415
+ ### FindUpName
3416
+
3417
+ ```ts
3418
+ type FindUpName: string[] | string | (directory) => FindUpNameFnResult;
3419
+ ```
3420
+
3421
+ #### Defined in
3422
+
3423
+ [packages/fs/src/types.ts:180](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L180)
3424
+
3425
+ ***
3426
+
3427
+ ### FindUpNameFnResult
3428
+
3429
+ ```ts
3430
+ type FindUpNameFnResult: PathLike | Promise<PathLike | typeof FIND_UP_STOP> | typeof FIND_UP_STOP | undefined;
3431
+ ```
3432
+
3433
+ #### Defined in
3434
+
3435
+ [packages/fs/src/types.ts:178](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L178)
3436
+
3437
+ ***
3438
+
3439
+ ### FindUpNameSync
3440
+
3441
+ ```ts
3442
+ type FindUpNameSync: string[] | string | (directory) => FindUpNameSyncFnResult;
3443
+ ```
3444
+
3445
+ #### Defined in
3446
+
3447
+ [packages/fs/src/types.ts:185](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L185)
3448
+
3449
+ ***
3450
+
3451
+ ### FindUpNameSyncFnResult
3452
+
3453
+ ```ts
3454
+ type FindUpNameSyncFnResult: PathLike | typeof FIND_UP_STOP | undefined;
3455
+ ```
3456
+
3457
+ #### Defined in
3458
+
3459
+ [packages/fs/src/types.ts:183](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L183)
3460
+
3461
+ ***
3462
+
3463
+ ### FindUpOptions
3464
+
3465
+ ```ts
3466
+ type FindUpOptions: object;
3467
+ ```
3468
+
3469
+ #### Type declaration
3470
+
3471
+ ##### allowSymlinks?
3472
+
3473
+ ```ts
3474
+ optional allowSymlinks: boolean;
3475
+ ```
3476
+
3477
+ ##### cwd?
3478
+
3479
+ ```ts
3480
+ optional cwd: URL | string;
3481
+ ```
3482
+
3483
+ ##### stopAt?
3484
+
3485
+ ```ts
3486
+ optional stopAt: URL | string;
3487
+ ```
3488
+
3489
+ ##### type?
3490
+
3491
+ ```ts
3492
+ optional type: "directory" | "file";
3493
+ ```
3494
+
3495
+ #### Defined in
3496
+
3497
+ [packages/fs/src/types.ts:170](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L170)
3498
+
3499
+ ***
3500
+
3501
+ ### JsonReplacer
3502
+
3503
+ ```ts
3504
+ type JsonReplacer: (number | string)[] | (this, key, value) => unknown | null;
3505
+ ```
3506
+
3507
+ #### Defined in
3508
+
3509
+ [packages/fs/src/types.ts:143](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L143)
3510
+
3511
+ ***
3512
+
3513
+ ### JsonReviver
3514
+
3515
+ ```ts
3516
+ type JsonReviver: Parameters<typeof JSON["parse"]>["1"];
3517
+ ```
3518
+
3519
+ #### Defined in
3520
+
3521
+ [packages/fs/src/types.ts:89](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L89)
3522
+
3523
+ ***
3524
+
3525
+ ### MoveOptions
3526
+
3527
+ ```ts
3528
+ type MoveOptions: object;
3529
+ ```
3530
+
3531
+ #### Type declaration
3532
+
3533
+ ##### cwd?
3534
+
3535
+ ```ts
3536
+ optional cwd: URL | string;
3537
+ ```
3538
+
3539
+ The working directory to find source files.
3540
+ The source and destination path are relative to this.
3541
+
3542
+ ###### Default
3543
+
3544
+ ```ts
3545
+ process.cwd()
3546
+ ```
3547
+
3548
+ ##### directoryMode?
3549
+
3550
+ ```ts
3551
+ readonly optional directoryMode: FilePermissions;
3552
+ ```
3553
+
3554
+ [Permissions](https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation) for created directories.
3555
+
3556
+ It has no effect on Windows.
3557
+
3558
+ ###### Default
3559
+
3560
+ ```ts
3561
+ 0o777
3562
+ ```
3563
+
3564
+ ##### overwrite?
3565
+
3566
+ ```ts
3567
+ readonly optional overwrite: boolean;
3568
+ ```
3569
+
3570
+ Overwrite existing destination file.
3571
+
3572
+ ###### Default
3573
+
3574
+ ```ts
3575
+ true
3576
+ ```
3577
+
3578
+ #### Defined in
3579
+
3580
+ [packages/fs/src/move/types.ts:3](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/move/types.ts#L3)
3581
+
3582
+ ***
3583
+
3584
+ ### ReadFileEncoding
3585
+
3586
+ ```ts
3587
+ type ReadFileEncoding:
3588
+ | "ascii"
3589
+ | "base64"
3590
+ | "base64url"
3591
+ | "hex"
3592
+ | "latin1"
3593
+ | "ucs-2"
3594
+ | "ucs2"
3595
+ | "utf-8"
3596
+ | "utf-16le"
3597
+ | "utf8"
3598
+ | "utf16le";
3599
+ ```
3600
+
3601
+ #### Defined in
3602
+
3603
+ [packages/fs/src/types.ts:61](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L61)
3604
+
3605
+ ***
3606
+
3607
+ ### ReadFileOptions\<C\>
3608
+
3609
+ ```ts
3610
+ type ReadFileOptions<C>: object;
3611
+ ```
3612
+
3613
+ #### Type Parameters
3614
+
3615
+ • **C**
3616
+
3617
+ #### Type declaration
3618
+
3619
+ ##### buffer?
3620
+
3621
+ ```ts
3622
+ optional buffer: boolean;
3623
+ ```
3624
+
3625
+ Return content as a Buffer. Default: `false`
3626
+
3627
+ ##### compression?
3628
+
3629
+ ```ts
3630
+ optional compression: C;
3631
+ ```
3632
+
3633
+ Compression method to decompress the file against. Default: `none`
3634
+
3635
+ ##### encoding?
3636
+
3637
+ ```ts
3638
+ optional encoding: ReadFileEncoding;
3639
+ ```
3640
+
3641
+ The encoding to use. Default: `utf8`
3642
+
3643
+ ###### See
3644
+
3645
+ https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
3646
+
3647
+ ##### flag?
3648
+
3649
+ ```ts
3650
+ optional flag: number | string;
3651
+ ```
3652
+
3653
+ The flag used to open the file. Default: `r`
3654
+
3655
+ #### Defined in
3656
+
3657
+ [packages/fs/src/types.ts:63](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L63)
3658
+
3659
+ ***
3660
+
3661
+ ### ReadJsonOptions
3662
+
3663
+ ```ts
3664
+ type ReadJsonOptions: CodeFrameOptions & object;
3665
+ ```
3666
+
3667
+ #### Type declaration
3668
+
3669
+ ##### beforeParse()?
3670
+
3671
+ ```ts
3672
+ optional beforeParse: (source) => string;
3673
+ ```
3674
+
3675
+ ###### Parameters
3676
+
3677
+ • **source**: `string`
3678
+
3679
+ ###### Returns
3680
+
3681
+ `string`
3682
+
3683
+ #### Defined in
3684
+
3685
+ [packages/fs/src/types.ts:104](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L104)
3686
+
3687
+ ***
3688
+
3689
+ ### WriteFileOptions
3690
+
3691
+ ```ts
3692
+ type WriteFileOptions: object;
3693
+ ```
3694
+
3695
+ #### Type declaration
3696
+
3697
+ ##### chown?
3698
+
3699
+ ```ts
3700
+ optional chown: object;
3701
+ ```
3702
+
3703
+ The group and user ID used to set the file ownership. Default: `undefined`
3704
+
3705
+ ##### chown.gid
3706
+
3707
+ ```ts
3708
+ gid: number;
3709
+ ```
3710
+
3711
+ ##### chown.uid
3712
+
3713
+ ```ts
3714
+ uid: number;
3715
+ ```
3716
+
3717
+ ##### encoding?
3718
+
3719
+ ```ts
3720
+ optional encoding: BufferEncoding | null;
3721
+ ```
3722
+
3723
+ The encoding to use. Default: `utf8`
3724
+
3725
+ ##### flag?
3726
+
3727
+ ```ts
3728
+ optional flag: string;
3729
+ ```
3730
+
3731
+ The flag used to write the file. Default: `w`
3732
+
3733
+ ##### mode?
3734
+
3735
+ ```ts
3736
+ optional mode: number;
3737
+ ```
3738
+
3739
+ The file mode (permission and sticky bits). Default: `0o666`
3740
+
3741
+ ##### overwrite?
3742
+
3743
+ ```ts
3744
+ optional overwrite: boolean;
3745
+ ```
3746
+
3747
+ Indicates whether the file should be overwritten if it already exists. Default: `false`
3748
+
3749
+ ##### recursive?
3750
+
3751
+ ```ts
3752
+ optional recursive: boolean;
3753
+ ```
3754
+
3755
+ Recursively create parent directories if needed. Default: `true`
3756
+
3757
+ #### Defined in
3758
+
3759
+ [packages/fs/src/types.ts:108](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L108)
3760
+
3761
+ ***
3762
+
3763
+ ### WriteJsonOptions
3764
+
3765
+ ```ts
3766
+ type WriteJsonOptions: WriteFileOptions & object;
3767
+ ```
3768
+
3769
+ #### Type declaration
3770
+
3771
+ ##### detectIndent?
3772
+
3773
+ ```ts
3774
+ optional detectIndent: boolean;
3775
+ ```
3776
+
3777
+ Detect indentation automatically if the file exists. Default: `false`
3778
+
3779
+ ##### indent?
3780
+
3781
+ ```ts
3782
+ optional indent: number | string;
3783
+ ```
3784
+
3785
+ The space used for pretty-printing.
3786
+
3787
+ Pass in `undefined` for no formatting.
3788
+
3789
+ ##### replacer?
3790
+
3791
+ ```ts
3792
+ optional replacer: JsonReplacer;
3793
+ ```
3794
+
3795
+ Passed into `JSON.stringify`.
3796
+
3797
+ ##### stringify()?
3798
+
3799
+ ```ts
3800
+ optional stringify: (data, replacer, space) => string;
3801
+ ```
3802
+
3803
+ Override the default `JSON.stringify` method.
3804
+
3805
+ ###### Parameters
3806
+
3807
+ • **data**: `unknown`
3808
+
3809
+ • **replacer**: [`JsonReplacer`](index.md#jsonreplacer)
3810
+
3811
+ • **space**: `number` \| `string` \| `undefined`
3812
+
3813
+ ###### Returns
3814
+
3815
+ `string`
3816
+
3817
+ #### Defined in
3818
+
3819
+ [packages/fs/src/types.ts:146](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L146)
3820
+
3821
+ ***
3822
+
3823
+ ### YamlReplacer
3824
+
3825
+ ```ts
3826
+ type YamlReplacer: JsonReplacer;
3827
+ ```
3828
+
3829
+ #### Defined in
3830
+
3831
+ [packages/fs/src/types.ts:144](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/types.ts#L144)
3832
+ # utils
3833
+
3834
+ ## Classes
3835
+
3836
+ ### JSONError
3837
+
3838
+ #### Extends
3839
+
3840
+ - `Error`
3841
+
3842
+ #### Constructors
3843
+
3844
+ ##### new JSONError()
3845
+
3846
+ ```ts
3847
+ new JSONError(message): JSONError
3848
+ ```
3849
+
3850
+ ###### Parameters
3851
+
3852
+ • **message**: `string`
3853
+
3854
+ ###### Returns
3855
+
3856
+ [`JSONError`](utils.md#jsonerror)
3857
+
3858
+ ###### Overrides
3859
+
3860
+ `Error.constructor`
3861
+
3862
+ ###### Defined in
3863
+
3864
+ [packages/fs/src/error/json-error.ts:11](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/json-error.ts#L11)
3865
+
3866
+ #### Accessors
3867
+
3868
+ ##### message
3869
+
3870
+ ```ts
3871
+ get message(): string
3872
+ ```
3873
+
3874
+ ```ts
3875
+ set message(message): void
3876
+ ```
3877
+
3878
+ ###### Parameters
3879
+
3880
+ • **message**: `string`
3881
+
3882
+ ###### Returns
3883
+
3884
+ `string`
3885
+
3886
+ ###### Overrides
3887
+
3888
+ `Error.message`
3889
+
3890
+ ###### Defined in
3891
+
3892
+ [packages/fs/src/error/json-error.ts:21](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/json-error.ts#L21)
3893
+
3894
+ #### Methods
3895
+
3896
+ ##### captureStackTrace()
3897
+
3898
+ ```ts
3899
+ static captureStackTrace(targetObject, constructorOpt?): void
3900
+ ```
3901
+
3902
+ Create .stack property on a target object
3903
+
3904
+ ###### Parameters
3905
+
3906
+ • **targetObject**: `object`
3907
+
3908
+ • **constructorOpt?**: `Function`
3909
+
3910
+ ###### Returns
3911
+
3912
+ `void`
3913
+
3914
+ ###### Inherited from
3915
+
3916
+ `Error.captureStackTrace`
3917
+
3918
+ ###### Defined in
3919
+
3920
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:20
3921
+
3922
+ #### Properties
3923
+
3924
+ ##### cause?
3925
+
3926
+ ```ts
3927
+ optional cause: unknown;
3928
+ ```
3929
+
3930
+ ###### Inherited from
3931
+
3932
+ `Error.cause`
3933
+
3934
+ ###### Defined in
3935
+
3936
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24
3937
+
3938
+ ##### codeFrame
3939
+
3940
+ ```ts
3941
+ codeFrame: string;
3942
+ ```
3943
+
3944
+ ###### Defined in
3945
+
3946
+ [packages/fs/src/error/json-error.ts:4](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/json-error.ts#L4)
3947
+
3948
+ ##### fileName
3949
+
3950
+ ```ts
3951
+ fileName: string;
3952
+ ```
3953
+
3954
+ ###### Defined in
3955
+
3956
+ [packages/fs/src/error/json-error.ts:2](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/json-error.ts#L2)
3957
+
3958
+ ##### name
3959
+
3960
+ ```ts
3961
+ readonly name: "JSONError" = "JSONError";
3962
+ ```
3963
+
3964
+ ###### Overrides
3965
+
3966
+ `Error.name`
3967
+
3968
+ ###### Defined in
3969
+
3970
+ [packages/fs/src/error/json-error.ts:7](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/error/json-error.ts#L7)
3971
+
3972
+ ##### stack?
3973
+
3974
+ ```ts
3975
+ optional stack: string;
3976
+ ```
3977
+
3978
+ ###### Inherited from
3979
+
3980
+ `Error.stack`
3981
+
3982
+ ###### Defined in
3983
+
3984
+ node\_modules/.pnpm/typescript@5.6.3/node\_modules/typescript/lib/lib.es5.d.ts:1078
3985
+
3986
+ ##### prepareStackTrace()?
3987
+
3988
+ ```ts
3989
+ static optional prepareStackTrace: (err, stackTraces) => any;
3990
+ ```
3991
+
3992
+ Optional override for formatting stack traces
3993
+
3994
+ ###### Parameters
3995
+
3996
+ • **err**: `Error`
3997
+
3998
+ • **stackTraces**: `CallSite`[]
3999
+
4000
+ ###### Returns
4001
+
4002
+ `any`
4003
+
4004
+ ###### See
4005
+
4006
+ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
4007
+
4008
+ ###### Inherited from
4009
+
4010
+ `Error.prepareStackTrace`
4011
+
4012
+ ###### Defined in
4013
+
4014
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:27
4015
+
4016
+ ##### stackTraceLimit
4017
+
4018
+ ```ts
4019
+ static stackTraceLimit: number;
4020
+ ```
4021
+
4022
+ ###### Inherited from
4023
+
4024
+ `Error.stackTraceLimit`
4025
+
4026
+ ###### Defined in
4027
+
4028
+ node\_modules/.pnpm/@types+node@18.19.15/node\_modules/@types/node/globals.d.ts:29
4029
+
4030
+ ## Functions
4031
+
4032
+ ### assertValidFileContents()
4033
+
4034
+ ```ts
4035
+ function assertValidFileContents(contents): void
4036
+ ```
4037
+
4038
+ #### Parameters
4039
+
4040
+ • **contents**: `any`
4041
+
4042
+ #### Returns
4043
+
4044
+ `void`
4045
+
4046
+ #### Defined in
4047
+
4048
+ [packages/fs/src/utils/assert-valid-file-contents.ts:2](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/utils/assert-valid-file-contents.ts#L2)
4049
+
4050
+ ***
4051
+
4052
+ ### assertValidFileOrDirectoryPath()
4053
+
4054
+ ```ts
4055
+ function assertValidFileOrDirectoryPath(fileOrDirectoryPath): void
4056
+ ```
4057
+
4058
+ #### Parameters
4059
+
4060
+ • **fileOrDirectoryPath**: `any`
4061
+
4062
+ #### Returns
4063
+
4064
+ `void`
4065
+
4066
+ #### Defined in
4067
+
4068
+ [packages/fs/src/utils/assert-valid-file-or-directory-path.ts:2](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/utils/assert-valid-file-or-directory-path.ts#L2)
4069
+
4070
+ ***
4071
+
4072
+ ### parseJson()
4073
+
4074
+ #### parseJson(string, filename, options)
4075
+
4076
+ ```ts
4077
+ function parseJson<T>(
4078
+ string,
4079
+ filename?,
4080
+ options?): T
4081
+ ```
4082
+
4083
+ ##### Type Parameters
4084
+
4085
+ • **T** = `JsonValue`
4086
+
4087
+ ##### Parameters
4088
+
4089
+ • **string**: `string`
4090
+
4091
+ • **filename?**: `string`
4092
+
4093
+ • **options?**: `CodeFrameOptions`
4094
+
4095
+ ##### Returns
4096
+
4097
+ `T`
4098
+
4099
+ ##### Defined in
4100
+
4101
+ [packages/fs/src/utils/parse-json.ts:60](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/utils/parse-json.ts#L60)
4102
+
4103
+ #### parseJson(string, reviver, fileName, options)
4104
+
4105
+ ```ts
4106
+ function parseJson<T>(
4107
+ string,
4108
+ reviver,
4109
+ fileName?,
4110
+ options?): T
4111
+ ```
4112
+
4113
+ ##### Type Parameters
4114
+
4115
+ • **T** = `JsonValue`
4116
+
4117
+ ##### Parameters
4118
+
4119
+ • **string**: `string`
4120
+
4121
+ • **reviver**
4122
+
4123
+ • **fileName?**: `string`
4124
+
4125
+ • **options?**: `CodeFrameOptions`
4126
+
4127
+ ##### Returns
4128
+
4129
+ `T`
4130
+
4131
+ ##### Defined in
4132
+
4133
+ [packages/fs/src/utils/parse-json.ts:61](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/utils/parse-json.ts#L61)
4134
+
4135
+ ***
4136
+
4137
+ ### stripJsonComments()
4138
+
4139
+ ```ts
4140
+ function stripJsonComments(jsonString, __namedParameters): string
4141
+ ```
4142
+
4143
+ #### Parameters
4144
+
4145
+ • **jsonString**: `string`
4146
+
4147
+ • **\_\_namedParameters** = `{}`
4148
+
4149
+ • **\_\_namedParameters.whitespace**: `boolean` = `true`
4150
+
4151
+ #### Returns
4152
+
4153
+ `string`
4154
+
4155
+ #### Defined in
4156
+
4157
+ [packages/fs/src/utils/strip-json-comments.ts:5](https://github.com/visulima/visulima/blob/bfac7b2e6316f251f37670225ead9075ee3d4299/packages/fs/src/utils/strip-json-comments.ts#L5)
4158
+
4159
+ ***
4160
+
4161
+ ### toPath()
4162
+
4163
+ ```ts
4164
+ function toPath(urlOrPath): string
4165
+ ```
4166
+
4167
+ #### Parameters
4168
+
4169
+ • **urlOrPath**: `string` \| `URL`
4170
+
4171
+ #### Returns
4172
+
4173
+ `string`
4174
+
4175
+ #### Defined in
4176
+
4177
+ node\_modules/.pnpm/@visulima+path@1.1.1/node\_modules/@visulima/path/dist/utils.d.mts:7
4178
+
4179
+ <!-- /TYPEDOC -->
4180
+
436
4181
  ## Supported Node.js Versions
437
4182
 
438
4183
  Libraries in this ecosystem make the best effort to track [Node.js’ release schedule](https://github.com/nodejs/release#release-schedule).