Hierarchy
- FS
Properties
Optional
contains
• contains? : undefined | function
Defined in src/fs/fs.ts:13
check if file is contained in root
, always return true
by default. Warning: not setting this could expose path traversal vulnerabilities.
Optional
dirname
• dirname? : undefined | function
Defined in src/fs/fs.ts:17
required for relative path resolving
exists
• exists: function
Defined in src/fs/fs.ts:3
check if a file exists asynchronously
Type declaration:
▸ (filepath
: string): Promise‹boolean›
Parameters:
Name | Type |
---|---|
filepath |
string |
existsSync
• existsSync: function
Defined in src/fs/fs.ts:5
check if a file exists synchronously
Type declaration:
▸ (filepath
: string): boolean
Parameters:
Name | Type |
---|---|
filepath |
string |
Optional
fallback
• fallback? : undefined | function
Defined in src/fs/fs.ts:19
fallback file for lookup failure
readFile
• readFile: function
Defined in src/fs/fs.ts:7
read a file asynchronously
Type declaration:
▸ (filepath
: string): Promise‹string›
Parameters:
Name | Type |
---|---|
filepath |
string |
readFileSync
• readFileSync: function
Defined in src/fs/fs.ts:9
read a file synchronously
Type declaration:
▸ (filepath
: string): string
Parameters:
Name | Type |
---|---|
filepath |
string |
resolve
• resolve: function
Defined in src/fs/fs.ts:11
resolve a file against directory, for given ext
option
Type declaration:
▸ (dir
: string, file
: string, ext
: string): string
Parameters:
Name | Type |
---|---|
dir |
string |
file |
string |
ext |
string |
Optional
sep
• sep? : undefined | string
Defined in src/fs/fs.ts:15
defaults to “/“