pwd-fs 2.4.2 → 3.1.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.
Files changed (101) hide show
  1. package/.travis.yml +2 -3
  2. package/__tests__/__fmock.ts +45 -0
  3. package/__tests__/append.spec.ts +72 -0
  4. package/__tests__/bitmask.spec.ts +23 -0
  5. package/__tests__/chmod.spec.ts +78 -0
  6. package/__tests__/chown.spec.ts +88 -0
  7. package/{test → __tests__}/constructor.spec.ts +3 -6
  8. package/__tests__/copy.spec.ts +102 -0
  9. package/__tests__/mkdir.spec.ts +120 -0
  10. package/__tests__/read.spec.ts +92 -0
  11. package/__tests__/readdir.spec.ts +87 -0
  12. package/__tests__/remove.spec.ts +78 -0
  13. package/__tests__/rename.spec.ts +84 -0
  14. package/__tests__/stat.spec.ts +100 -0
  15. package/__tests__/symlink.spec.ts +95 -0
  16. package/__tests__/test.spec.ts +82 -0
  17. package/__tests__/write.spec.ts +104 -0
  18. package/appveyor.yml +2 -4
  19. package/jest.config.ts +14 -0
  20. package/lib/__tests__/__fmock.d.ts +5 -0
  21. package/lib/index.js +24 -0
  22. package/lib/powered-file-system.js +260 -0
  23. package/lib/recurse-io-sync.js +90 -0
  24. package/lib/recurse-io.js +194 -0
  25. package/lib/src/index.d.ts +6 -186
  26. package/lib/src/powered-file-system.d.ts +155 -0
  27. package/lib/src/recurse-io-sync.d.ts +10 -5
  28. package/lib/src/recurse-io.d.ts +14 -6
  29. package/package.json +18 -14
  30. package/readme.md +0 -13
  31. package/rollup.config.js +16 -0
  32. package/src/index.ts +29 -626
  33. package/src/powered-file-system.ts +525 -0
  34. package/src/recurse-io-sync.ts +77 -71
  35. package/src/recurse-io.ts +181 -176
  36. package/tsconfig.json +12 -5
  37. package/lib/src/index.js +0 -297
  38. package/lib/src/index.js.map +0 -1
  39. package/lib/src/recurse-io-sync.js +0 -83
  40. package/lib/src/recurse-io-sync.js.map +0 -1
  41. package/lib/src/recurse-io.js +0 -188
  42. package/lib/src/recurse-io.js.map +0 -1
  43. package/lib/test/append.spec.js +0 -99
  44. package/lib/test/append.spec.js.map +0 -1
  45. package/lib/test/bitmask.spec.js +0 -29
  46. package/lib/test/bitmask.spec.js.map +0 -1
  47. package/lib/test/chmod.spec.js +0 -104
  48. package/lib/test/chmod.spec.js.map +0 -1
  49. package/lib/test/chown.spec.js +0 -94
  50. package/lib/test/chown.spec.js.map +0 -1
  51. package/lib/test/constructor.spec.js +0 -20
  52. package/lib/test/constructor.spec.js.map +0 -1
  53. package/lib/test/copy.spec.js +0 -135
  54. package/lib/test/copy.spec.js.map +0 -1
  55. package/lib/test/mkdir.spec.js +0 -147
  56. package/lib/test/mkdir.spec.js.map +0 -1
  57. package/lib/test/read.spec.js +0 -104
  58. package/lib/test/read.spec.js.map +0 -1
  59. package/lib/test/readdir.spec.js +0 -112
  60. package/lib/test/readdir.spec.js.map +0 -1
  61. package/lib/test/remove.spec.js +0 -84
  62. package/lib/test/remove.spec.js.map +0 -1
  63. package/lib/test/rename.spec.js +0 -98
  64. package/lib/test/rename.spec.js.map +0 -1
  65. package/lib/test/stat.spec.js +0 -104
  66. package/lib/test/stat.spec.js.map +0 -1
  67. package/lib/test/symlink.spec.js +0 -118
  68. package/lib/test/symlink.spec.js.map +0 -1
  69. package/lib/test/test.spec.js +0 -89
  70. package/lib/test/test.spec.js.map +0 -1
  71. package/lib/test/write.spec.js +0 -133
  72. package/lib/test/write.spec.js.map +0 -1
  73. package/test/append.spec.ts +0 -125
  74. package/test/bitmask.spec.ts +0 -26
  75. package/test/chmod.spec.ts +0 -127
  76. package/test/chown.spec.ts +0 -118
  77. package/test/copy.spec.ts +0 -171
  78. package/test/mkdir.spec.ts +0 -187
  79. package/test/read.spec.ts +0 -130
  80. package/test/readdir.spec.ts +0 -134
  81. package/test/remove.spec.ts +0 -102
  82. package/test/rename.spec.ts +0 -122
  83. package/test/stat.spec.ts +0 -131
  84. package/test/symlink.spec.ts +0 -146
  85. package/test/test.spec.ts +0 -113
  86. package/test/write.spec.ts +0 -167
  87. /package/lib/{test → __tests__}/append.spec.d.ts +0 -0
  88. /package/lib/{test → __tests__}/bitmask.spec.d.ts +0 -0
  89. /package/lib/{test → __tests__}/chmod.spec.d.ts +0 -0
  90. /package/lib/{test → __tests__}/chown.spec.d.ts +0 -0
  91. /package/lib/{test → __tests__}/constructor.spec.d.ts +0 -0
  92. /package/lib/{test → __tests__}/copy.spec.d.ts +0 -0
  93. /package/lib/{test → __tests__}/mkdir.spec.d.ts +0 -0
  94. /package/lib/{test → __tests__}/read.spec.d.ts +0 -0
  95. /package/lib/{test → __tests__}/readdir.spec.d.ts +0 -0
  96. /package/lib/{test → __tests__}/remove.spec.d.ts +0 -0
  97. /package/lib/{test → __tests__}/rename.spec.d.ts +0 -0
  98. /package/lib/{test → __tests__}/stat.spec.d.ts +0 -0
  99. /package/lib/{test → __tests__}/symlink.spec.d.ts +0 -0
  100. /package/lib/{test → __tests__}/test.spec.d.ts +0 -0
  101. /package/lib/{test → __tests__}/write.spec.d.ts +0 -0
@@ -1,186 +1,6 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import fs from 'fs';
4
- export declare type Mode = 'e' | 'r' | 'w' | 'x';
5
- export declare type Flag = Mode | 'a';
6
- export interface Constants {
7
- e: number;
8
- r: number;
9
- w: number;
10
- x: number;
11
- }
12
- export default class PoweredFileSystem {
13
- readonly pwd: string;
14
- readonly constants: Constants;
15
- constructor(pwd?: string);
16
- test(src: string, options: {
17
- sync: true;
18
- resolve?: boolean;
19
- flag?: Mode;
20
- }): boolean;
21
- test(src: string, options?: {
22
- sync?: false;
23
- resolve?: boolean;
24
- flag?: Mode;
25
- }): Promise<boolean>;
26
- stat(src: string, options: {
27
- sync: true;
28
- resolve?: boolean;
29
- }): fs.Stats;
30
- stat(src: string, options?: {
31
- sync?: false;
32
- resolve?: boolean;
33
- }): Promise<fs.Stats>;
34
- chmod(src: string, mode: number, options: {
35
- sync: true;
36
- resolve?: boolean;
37
- }): void;
38
- chmod(src: string, mode: number, options?: {
39
- sync?: false;
40
- resolve?: boolean;
41
- }): Promise<void>;
42
- chown(src: string, uid: number, gid: number, options: {
43
- sync: true;
44
- resolve?: boolean;
45
- }): void;
46
- chown(src: string, uid: number, gid: number, options?: {
47
- sync?: false;
48
- resolve?: boolean;
49
- }): Promise<void>;
50
- symlink(src: string, use: string, options: {
51
- sync: true;
52
- resolve?: boolean;
53
- }): void;
54
- symlink(src: string, use: string, options?: {
55
- sync?: false;
56
- resolve?: boolean;
57
- }): Promise<void>;
58
- copy(src: string, dir: string, options: {
59
- sync: true;
60
- resolve?: boolean;
61
- umask?: number;
62
- }): void;
63
- copy(src: string, dir: string, options?: {
64
- sync?: false;
65
- resolve?: boolean;
66
- umask?: number;
67
- }): Promise<void>;
68
- rename(src: string, use: string, options: {
69
- sync: true;
70
- resolve?: boolean;
71
- }): void;
72
- rename(src: string, use: string, options?: {
73
- sync?: false;
74
- resolve?: boolean;
75
- }): Promise<void>;
76
- remove(src: string, options: {
77
- sync: true;
78
- resolve?: boolean;
79
- }): void;
80
- remove(src: string, options?: {
81
- sync?: false;
82
- resolve?: boolean;
83
- }): Promise<void>;
84
- read(src: string, options: {
85
- sync: true;
86
- resolve?: boolean;
87
- encoding?: BufferEncoding;
88
- flag?: Flag;
89
- }): string;
90
- read(src: string, options: {
91
- sync: true;
92
- resolve?: boolean;
93
- encoding?: null;
94
- flag?: Flag;
95
- }): Buffer;
96
- read(src: string, options: {
97
- sync?: false;
98
- resolve?: boolean;
99
- encoding: null;
100
- flag?: Flag;
101
- }): Promise<Buffer>;
102
- read(src: string, options?: {
103
- sync?: false;
104
- resolve?: boolean;
105
- encoding?: BufferEncoding;
106
- flag?: Flag;
107
- }): Promise<string>;
108
- write(src: string, data: Buffer, options: {
109
- sync: true;
110
- resolve?: boolean;
111
- encoding: null;
112
- umask?: number;
113
- flag?: Flag;
114
- }): void;
115
- write(src: string, data: string, options: {
116
- sync: true;
117
- resolve?: boolean;
118
- encoding?: BufferEncoding;
119
- umask?: number;
120
- flag?: Flag;
121
- }): void;
122
- write(src: string, data: Buffer, options: {
123
- sync?: false;
124
- resolve?: boolean;
125
- encoding: null;
126
- umask?: number;
127
- flag?: Flag;
128
- }): Promise<void>;
129
- write(src: string, data: string, options?: {
130
- sync?: false;
131
- resolve?: boolean;
132
- encoding?: BufferEncoding;
133
- umask?: number;
134
- flag?: Flag;
135
- }): Promise<void>;
136
- append(src: string, data: Buffer, options: {
137
- sync: true;
138
- resolve?: boolean;
139
- encoding: null;
140
- umask?: number;
141
- flag?: Flag;
142
- }): void;
143
- append(src: string, data: string, options: {
144
- sync: true;
145
- resolve?: boolean;
146
- encoding?: BufferEncoding;
147
- umask?: number;
148
- flag?: Flag;
149
- }): void;
150
- append(src: string, data: Buffer, options: {
151
- sync?: false;
152
- resolve?: boolean;
153
- encoding: null;
154
- umask?: number;
155
- flag?: Flag;
156
- }): Promise<void>;
157
- append(src: string, data: string, options?: {
158
- sync?: false;
159
- resolve?: boolean;
160
- encoding?: BufferEncoding;
161
- umask?: number;
162
- flag?: Flag;
163
- }): Promise<void>;
164
- readdir(dir: string, options: {
165
- sync: true;
166
- resolve?: boolean;
167
- encoding?: BufferEncoding | null;
168
- }): string[];
169
- readdir(dir: string, options?: {
170
- sync?: false;
171
- resolve?: boolean;
172
- encoding?: BufferEncoding | null;
173
- }): Promise<string[]>;
174
- mkdir(dir: string, options: {
175
- sync: true;
176
- resolve?: boolean;
177
- umask?: number;
178
- }): void;
179
- mkdir(dir: string, options?: {
180
- sync?: false;
181
- resolve?: boolean;
182
- umask?: number;
183
- }): Promise<void>;
184
- private resolve;
185
- static bitmask(mode: number): number;
186
- }
1
+ import { type Mode as TMode, type Flag as TFlag, type Stats as TStats, PoweredFileSystem } from './powered-file-system';
2
+ export type Mode = TMode;
3
+ export type Flag = TFlag;
4
+ export type Stats = TStats;
5
+ export declare const bitmask: typeof PoweredFileSystem.bitmask;
6
+ export default PoweredFileSystem;
@@ -0,0 +1,155 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import fs from 'node:fs';
4
+ export type Mode = keyof IConstants;
5
+ export type Flag = Mode | 'a';
6
+ export type Stats = fs.Stats;
7
+ export interface IConstants {
8
+ e: number;
9
+ r: number;
10
+ w: number;
11
+ x: number;
12
+ }
13
+ export declare class PoweredFileSystem {
14
+ readonly pwd: string;
15
+ readonly constants: IConstants;
16
+ constructor(pwd?: string);
17
+ private resolve;
18
+ static bitmask(mode: number): number;
19
+ test(src: string, options: {
20
+ sync: true;
21
+ flag?: Mode;
22
+ }): boolean;
23
+ test(src: string, options?: {
24
+ sync?: false;
25
+ flag?: Mode;
26
+ }): Promise<boolean>;
27
+ stat(src: string, options: {
28
+ sync: true;
29
+ }): Stats;
30
+ stat(src: string, options?: {
31
+ sync?: false;
32
+ }): Promise<Stats>;
33
+ chmod(src: string, mode: number, options: {
34
+ sync: true;
35
+ }): void;
36
+ chmod(src: string, mode: number, options?: {
37
+ sync?: false;
38
+ }): Promise<void>;
39
+ chown(src: string, uid: number, gid: number, options: {
40
+ sync: true;
41
+ }): void;
42
+ chown(src: string, uid: number, gid: number, options?: {
43
+ sync?: false;
44
+ }): Promise<void>;
45
+ symlink(src: string, use: string, options: {
46
+ sync: true;
47
+ }): void;
48
+ symlink(src: string, use: string, options?: {
49
+ sync?: false;
50
+ }): Promise<void>;
51
+ copy(src: string, dir: string, options: {
52
+ sync: true;
53
+ umask?: number;
54
+ }): void;
55
+ copy(src: string, dir: string, options?: {
56
+ sync?: false;
57
+ umask?: number;
58
+ }): Promise<void>;
59
+ rename(src: string, use: string, options: {
60
+ sync: true;
61
+ }): void;
62
+ rename(src: string, use: string, options?: {
63
+ sync?: false;
64
+ }): Promise<void>;
65
+ remove(src: string, options: {
66
+ sync: true;
67
+ }): void;
68
+ remove(src: string, options?: {
69
+ sync?: false;
70
+ }): Promise<void>;
71
+ read(src: string, options: {
72
+ sync: true;
73
+ encoding?: BufferEncoding;
74
+ flag?: Flag;
75
+ }): string;
76
+ read(src: string, options: {
77
+ sync: true;
78
+ encoding?: null;
79
+ flag?: Flag;
80
+ }): Buffer;
81
+ read(src: string, options: {
82
+ sync?: false;
83
+ encoding: null;
84
+ flag?: Flag;
85
+ }): Promise<Buffer>;
86
+ read(src: string, options?: {
87
+ sync?: false;
88
+ encoding?: BufferEncoding;
89
+ flag?: Flag;
90
+ }): Promise<string>;
91
+ write(src: string, data: Buffer, options: {
92
+ sync: true;
93
+ encoding: null;
94
+ umask?: number;
95
+ flag?: Flag;
96
+ }): void;
97
+ write(src: string, data: string, options: {
98
+ sync: true;
99
+ encoding?: BufferEncoding;
100
+ umask?: number;
101
+ flag?: Flag;
102
+ }): void;
103
+ write(src: string, data: Buffer, options: {
104
+ sync?: false;
105
+ encoding: null;
106
+ umask?: number;
107
+ flag?: Flag;
108
+ }): Promise<void>;
109
+ write(src: string, data: string, options?: {
110
+ sync?: false;
111
+ encoding?: BufferEncoding;
112
+ umask?: number;
113
+ flag?: Flag;
114
+ }): Promise<void>;
115
+ append(src: string, data: Buffer, options: {
116
+ sync: true;
117
+ encoding: null;
118
+ umask?: number;
119
+ flag?: Flag;
120
+ }): void;
121
+ append(src: string, data: string, options: {
122
+ sync: true;
123
+ encoding?: BufferEncoding;
124
+ umask?: number;
125
+ flag?: Flag;
126
+ }): void;
127
+ append(src: string, data: Buffer, options: {
128
+ sync?: false;
129
+ encoding: null;
130
+ umask?: number;
131
+ flag?: Flag;
132
+ }): Promise<void>;
133
+ append(src: string, data: string, options?: {
134
+ sync?: false;
135
+ encoding?: BufferEncoding;
136
+ umask?: number;
137
+ flag?: Flag;
138
+ }): Promise<void>;
139
+ readdir(dir: string, options: {
140
+ sync: true;
141
+ encoding?: BufferEncoding | null;
142
+ }): string[];
143
+ readdir(dir: string, options?: {
144
+ sync?: false;
145
+ encoding?: BufferEncoding | null;
146
+ }): Promise<string[]>;
147
+ mkdir(dir: string, options: {
148
+ sync: true;
149
+ umask?: number;
150
+ }): void;
151
+ mkdir(dir: string, options?: {
152
+ sync?: false;
153
+ umask?: number;
154
+ }): Promise<void>;
155
+ }
@@ -1,8 +1,13 @@
1
+ declare function chmod(src: string, mode: number): void;
2
+ declare function chown(src: string, uid: number, gid: number): void;
3
+ declare function copy(src: string, dir: string, umask: number): void;
4
+ declare function remove(src: string): void;
5
+ declare function mkdir(dir: string, umask: number): void;
1
6
  declare const _default: {
2
- chmod(src: string, mode: number): void;
3
- chown(src: string, uid: number, gid: number): void;
4
- copy(src: string, dir: string, umask: number): void;
5
- remove(src: string): void;
6
- mkdir(dir: string, umask: number): void;
7
+ chmod: typeof chmod;
8
+ chown: typeof chown;
9
+ copy: typeof copy;
10
+ remove: typeof remove;
11
+ mkdir: typeof mkdir;
7
12
  };
8
13
  export default _default;
@@ -1,9 +1,17 @@
1
- import fs from 'fs';
1
+ /// <reference types="node" />
2
+ import fs from 'node:fs';
3
+ export type Files = Array<string>;
4
+ export type NoParamCallback = fs.NoParamCallback;
5
+ declare function chmod(src: string, mode: number, callback: NoParamCallback): void;
6
+ declare function chown(src: string, uid: number, gid: number, callback: NoParamCallback): void;
7
+ declare function copy(src: string, dir: string, umask: number, callback: NoParamCallback): void;
8
+ declare function remove(src: string, callback: NoParamCallback): void;
9
+ declare function mkdir(dir: string, umask: number, callback: NoParamCallback): void;
2
10
  declare const _default: {
3
- chmod(src: string, mode: number, callback: fs.NoParamCallback): void;
4
- chown(src: string, uid: number, gid: number, callback: fs.NoParamCallback): void;
5
- copy(src: string, dir: string, umask: number, callback: fs.NoParamCallback): void;
6
- remove(src: string, callback: fs.NoParamCallback): void;
7
- mkdir(dir: string, umask: number, callback: fs.NoParamCallback): void;
11
+ chmod: typeof chmod;
12
+ chown: typeof chown;
13
+ copy: typeof copy;
14
+ remove: typeof remove;
15
+ mkdir: typeof mkdir;
8
16
  };
9
17
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pwd-fs",
3
- "version": "2.4.2",
3
+ "version": "3.1.3",
4
4
  "description": "Extend the file system the capabilities of declaring the present working directory and recursive execution",
5
5
  "keywords": [
6
6
  "umask",
@@ -27,23 +27,27 @@
27
27
  "url": "https://github.com/woodger/pwd-fs.git"
28
28
  },
29
29
  "engines": {
30
- "node": ">=8.12.0"
30
+ "node": ">=13.2.0"
31
31
  },
32
- "main": "./lib/src/index.js",
32
+ "type": "module",
33
+ "main": "./lib/index.js",
33
34
  "types": "./lib/src/index.d.ts",
34
35
  "scripts": {
35
- "build": "tsc",
36
- "test": "mocha ./lib/test"
36
+ "build": "rollup -c",
37
+ "test": "jest"
37
38
  },
38
39
  "devDependencies": {
39
- "@tsconfig/node16": "^1.0.3",
40
- "@types/chance": "^1.1.1",
41
- "@types/mocha": "^10.0.0",
42
- "@types/mock-fs": "^4.13.0",
43
- "@types/node": "^18.11.9",
44
- "chance": "^1.1.9",
45
- "mocha": "^10.1.0",
46
- "mock-fs": "^5.2.0",
47
- "typescript": "^4.8.4"
40
+ "@rollup/plugin-node-resolve": "^15.2.3",
41
+ "@rollup/plugin-typescript": "^11.1.6",
42
+ "@types/chance": "^1.1.6",
43
+ "@types/jest": "^29.5.12",
44
+ "@types/node": "^20.12.7",
45
+ "chance": "^1.1.11",
46
+ "jest": "^29.7.0",
47
+ "rollup": "^4.14.3",
48
+ "ts-jest": "^29.1.2",
49
+ "ts-node": "^10.9.2",
50
+ "tslib": "^2.6.2",
51
+ "typescript": "^5.4.5"
48
52
  }
49
53
  }
package/readme.md CHANGED
@@ -100,7 +100,6 @@ const pfs = new PoweredFileSystem(__dirname);
100
100
 
101
101
  - `src` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the resource in the file system. Relative paths will be resolved relative to the present working directory as specified by `pfs.pwd`.
102
102
  - `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>
103
- - `resolve` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Declaration whether relative paths will be resolved. **Default:** `true`.
104
103
  - `flag` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Is an optional string that specifies the accessibility checks to be performed. **Default:** `'e'`.
105
104
  - `sync` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Synchronous execution. **Default:** `false`.
106
105
  - returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)> Following successful read, the `Promise` is resolved with an value with a `boolean`.
@@ -126,7 +125,6 @@ Flag | Description
126
125
 
127
126
  - `src` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the resource in the file system. Relative paths will be resolved relative to the present working directory as specified by `pfs.pwd`.
128
127
  - `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>
129
- - `resolve` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Declaration whether relative paths will be resolved. **Default:** `true`.
130
128
  - `sync` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Synchronous execution. **Default:** `false`.
131
129
  - returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)> Following successful read, the `Promise` is resolved with an value with a `fs.Stats`.
132
130
 
@@ -137,7 +135,6 @@ These functions return information about a resource in the file system.
137
135
  - `src` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the resource in the file system. Relative paths will be resolved relative to the present working directory as specified by `pfs.pwd`.
138
136
  - `mode` <[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)> Is a numeric `bitmask` created using a logical `OR`.
139
137
  - `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>
140
- - `resolve` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Declaration whether relative paths will be resolved. **Default:** `true`.
141
138
  - `sync` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Synchronous execution. **Default:** `false`.
142
139
  - returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)> Following successful change, the `Promise` is resolved with an value with a `undefined`.
143
140
 
@@ -160,7 +157,6 @@ See manuals [chmod(2)](http://man7.org/linux/man-pages/man2/chmod.2.html)
160
157
  - `uid` <[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>
161
158
  - `gid` <[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>
162
159
  - `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>
163
- - `resolve` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Declaration whether relative paths will be resolved. **Default:** `true`.
164
160
  - `sync` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Synchronous execution. **Default:** `false`.
165
161
  - returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)> Following successful change, the `Promise` is resolved with an value with a `undefined`.
166
162
 
@@ -172,7 +168,6 @@ See manuals [chown(2)](http://man7.org/linux/man-pages/man2/chown.2.html).
172
168
  - `src` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the resource in the file system. Relative paths will be resolved relative to the present working directory as specified by `pfs.pwd`.
173
169
  - `use` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the resource in the file system. If `use` exists, it will not be overwritten.
174
170
  - `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>
175
- - `resolve` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Declaration whether relative paths will be resolved. **Default:** `true`.
176
171
  - `sync` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Synchronous execution. **Default:** `false`.
177
172
  - returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)> Following successful created link, the `Promise` is resolved with an value with a `undefined`.
178
173
 
@@ -192,7 +187,6 @@ See manuals [symlink(2)](http://man7.org/linux/man-pages/man2/symlink.2.html).
192
187
  - `src` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the resource in the file system. Relative paths will be resolved relative to the present working directory as specified by `pfs.pwd`.
193
188
  - `dir` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the directory to which the resource is to be copied.
194
189
  - `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>
195
- - `resolve` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Declaration whether relative paths will be resolved. **Default:** `true`.
196
190
  - `umask` <[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)> Umask or file [mode creation mask](#mode-creation-mask) is a grouping of bits, each of which restricts how its corresponding permission is set for newly created files or directories. See manuals [umask(2)](http://man7.org/linux/man-pages/man2/umask.2.html). Not supported on Windows system. **Default:** `0o000`.
197
191
  - `sync` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Synchronous execution. **Default:** `false`.
198
192
  - returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)> Following successful copied, the `Promise` is resolved with an value with a `undefined`.
@@ -211,7 +205,6 @@ console.log(PoweredFileSystem.bitmask(mode) === 0o666); // true
211
205
  - `src` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the resource in the file system. Relative paths will be resolved relative to the present working directory as specified by `pfs.pwd`.
212
206
  - `use` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the resource in the file system.
213
207
  - `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>
214
- - `resolve` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Declaration whether relative paths will be resolved. **Default:** `true`.
215
208
  - `sync` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Synchronous execution. **Default:** `false`.
216
209
  - returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)> Following successful renamed, the `Promise` is resolved with an value with a `undefined`.
217
210
 
@@ -225,7 +218,6 @@ await pfs.rename('./path/old_name.txt', './path/new_name.txt');
225
218
 
226
219
  - `src` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the resource in the file system. Relative paths will be resolved relative to the present working directory as specified by `pfs.pwd`.
227
220
  - `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>
228
- - `resolve` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Declaration whether relative paths will be resolved. **Default:** `true`.
229
221
  - `sync` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Synchronous execution. **Default:** `false`.
230
222
  - returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)> Following successful removed, the `Promise` is resolved with an value with a `undefined`.
231
223
 
@@ -235,7 +227,6 @@ Asynchronously recursively remove a file or directory. Will be `resolve` if the
235
227
 
236
228
  - `src` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the resource in the file system. Relative paths will be resolved relative to the present working directory as specified by `pfs.pwd`.
237
229
  - `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>
238
- - `resolve` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Declaration whether relative paths will be resolved. **Default:** `true`.
239
230
  - `encoding` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> | <[null](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null)> Is the expected [string encoding](#string-encoding). **Default:** `'utf8'`.
240
231
  - `flag` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> See support of [file system flags](#file-system-flags). **Default:** `'r'`.
241
232
  - `sync` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Synchronous execution. **Default:** `false`.
@@ -253,7 +244,6 @@ console.log(content); // 'Lorem Ipsum...'
253
244
  - `src` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the resource in the file system. Relative paths will be resolved relative to the present working directory as specified by `pfs.pwd`.
254
245
  - `data` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>
255
246
  - `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>
256
- - `resolve` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Declaration whether relative paths will be resolved. **Default:** `true`.
257
247
  - `umask` <[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)> Umask or file [mode creation mask](#mode-creation-mask) is a grouping of bits, each of which restricts how its corresponding permission is set for newly created files or directories. See manuals [umask(2)](http://man7.org/linux/man-pages/man2/umask.2.html). Not supported on Windows system. **Default:** `0o000`.
258
248
  - `encoding` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Is the expected [string encoding](#string-encoding). **Default:** `'utf8'`.
259
249
  - `flag` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> See support of [file system flags](#file-system-flags). **Default:** `'w'`.
@@ -275,7 +265,6 @@ await pfs.write('./file.txt', '... some text');
275
265
  - `src` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the resource in the file system. Relative paths will be resolved relative to the present working directory as specified by `pfs.pwd`.
276
266
  - `data` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>
277
267
  - `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>
278
- - `resolve` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Declaration whether relative paths will be resolved. **Default:** `true`.
279
268
  - `umask` <[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)> Umask or file [mode creation mask](#mode-creation-mask) is a grouping of bits, each of which restricts how its corresponding permission is set for newly created files or directories. See manuals [umask(2)](http://man7.org/linux/man-pages/man2/umask.2.html). Not supported on Windows system. **Default:** `0o000`.
280
269
  - `encoding` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Is the expected [string encoding](#string-encoding). **Default:** `'utf8'`.
281
270
  - `flag` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> See support of [file system flags](#file-system-flags). **Default:** `'a'`.
@@ -298,7 +287,6 @@ await pfs.write('./file', 'some content', {
298
287
 
299
288
  - `dir` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the directory you want to read.
300
289
  - `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>
301
- - `resolve` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Declaration whether relative paths will be resolved. **Default:** `true`.
302
290
  - `encoding` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> | <[null](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null)> Is the expected [string encoding](#string-encoding). **Default:** `'utf8'`.
303
291
  - `sync` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Synchronous execution. **Default:** `false`.
304
292
  - returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)> Following successful write, the `Promise` is resolved with an value with a `Array` of the names of the files in the directory excluding `'.'` and `'..'`. If no encoding is specified <[null](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null)>, the data is returned as a <[Buffer](https://nodejs.org/api/buffer.html)> object. Otherwise, the data will be a string.
@@ -314,7 +302,6 @@ console.log(list); // ["icons", "logo.svg"]
314
302
 
315
303
  - `dir` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Absolute or relative path to the directory you want to read.
316
304
  - `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>
317
- - `resolve` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Declaration whether relative paths will be resolved. **Default:** `true`.
318
305
  - `umask` <[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)> Umask or file [mode creation mask](#mode-creation-mask) is a grouping of bits, each of which restricts how its corresponding permission is set for newly created files or directories. See manuals [umask(2)](http://man7.org/linux/man-pages/man2/umask.2.html). Not supported on Windows system. **Default:** `0o000`.
319
306
  - `encoding` <[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> Is the expected [string encoding](#string-encoding). **Default:** `'utf8'`.
320
307
  - `sync` <[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> Synchronous execution. **Default:** `false`.
@@ -0,0 +1,16 @@
1
+ import typescript from '@rollup/plugin-typescript';
2
+ import { nodeResolve } from '@rollup/plugin-node-resolve';
3
+
4
+ export default {
5
+ input: './src/index.ts',
6
+ output: {
7
+ preserveModules: true,
8
+ exports: 'named',
9
+ dir: 'lib',
10
+ format: 'cjs'
11
+ },
12
+ plugins: [
13
+ nodeResolve(),
14
+ typescript()
15
+ ]
16
+ }