Skip to content

Commit aa5c420

Browse files
committedFeb 3, 2025
updated fs
1 parent 375cd43 commit aa5c420

13 files changed

+256
-94
lines changed
 

‎.codebolt/projectState.json

+17-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"type": "leaf",
99
"data": {
1010
"views": [
11-
"Code"
11+
"Code",
12+
"0e7ba2fb-4f85-485e-a1ef-b12ef330b962",
13+
"Preview"
1214
],
1315
"activeView": "Code",
1416
"id": "1"
@@ -29,6 +31,20 @@
2931
"tabComponent": "props.defaultTabComponent",
3032
"title": "Code",
3133
"renderer": "always"
34+
},
35+
"0e7ba2fb-4f85-485e-a1ef-b12ef330b962": {
36+
"id": "0e7ba2fb-4f85-485e-a1ef-b12ef330b962",
37+
"contentComponent": "Terminal",
38+
"tabComponent": "props.defaultTabComponent",
39+
"title": "Terminal",
40+
"renderer": "always"
41+
},
42+
"Preview": {
43+
"id": "Preview",
44+
"contentComponent": "Preview",
45+
"tabComponent": "props.defaultTabComponent",
46+
"title": "Preview",
47+
"renderer": "always"
3248
}
3349
},
3450
"activeGroup": "1"

‎.codebolt/undefined.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"ports": [
3+
3000,
4+
1123,
5+
3000
6+
]
7+
}

‎docs/api/fs/createFile.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: createFile
3+
cbbaseinfo:
4+
description: 'Creates a new file with the specified content at the given path.'
5+
cbparameters:
6+
parameters:
7+
- name: fileName
8+
typeName: string
9+
description: The name of the file to create.
10+
- name: source
11+
typeName: string
12+
description: The source content to write into the file.
13+
- name: filePath
14+
typeName: string
15+
description: The path where the file should be created.
16+
returns:
17+
signatureTypeName: Promise
18+
description: A promise that resolves with the server response.
19+
typeArgs:
20+
- type: reference
21+
name: CreateFileResponse
22+
data:
23+
name: createFile
24+
category: fs
25+
link: createFile.md
26+
---
27+
<CBBaseInfo/>
28+
<CBParameters/>
29+
30+
### Example
31+
32+
```js
33+
// Let's assume you want to create a file named example.txt in the /home/user/documents directory with some content.
34+
35+
codebolt.fs.createFile('example.txt', 'This is the content of the file.', '/home/user/documents');

‎docs/api/fs/createFolder.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: createFolder
3+
cbbaseinfo:
4+
description: 'Creates a new folder at the specified path.'
5+
cbparameters:
6+
parameters:
7+
- name: folderName
8+
typeName: string
9+
description: The name of the folder to create.
10+
- name: folderPath
11+
typeName: string
12+
description: The path where the folder should be created.
13+
returns:
14+
signatureTypeName: Promise
15+
description: A promise that resolves with the server response.
16+
typeArgs:
17+
- type: reference
18+
name: CreateFolderResponse
19+
data:
20+
name: createFolder
21+
category: fs
22+
link: createFolder.md
23+
---
24+
<CBBaseInfo/>
25+
<CBParameters/>
26+
27+
### Example
28+
29+
```js
30+
// Let's assume you want to create a folder named "exampleFolder" in the /home/user/documents directory.
31+
32+
codebolt.fs.createFolder('exampleFolder', '/home/user/documents');

‎docs/api/fs/deleteFile.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: deleteFile
3+
cbbaseinfo:
4+
description: 'Deletes a file at the specified path.'
5+
cbparameters:
6+
parameters:
7+
- name: filename
8+
typeName: string
9+
description: The name of the file to delete.
10+
- name: filePath
11+
typeName: string
12+
description: The path of the file to delete.
13+
returns:
14+
signatureTypeName: Promise
15+
description: A promise that resolves with the server response.
16+
typeArgs:
17+
- type: reference
18+
name: DeleteFileResponse
19+
data:
20+
name: deleteFile
21+
category: fs
22+
link: deleteFile.md
23+
---
24+
<CBBaseInfo/>
25+
<CBParameters/>
26+
27+
### Example
28+
29+
```js
30+
// Let's assume you want to delete a file named example.txt in the /home/user/documents directory.
31+
32+
codebolt.fs.deleteFile('example.txt', '/home/user/documents');

‎docs/api/fs/deleteFolder.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: deleteFolder
3+
cbbaseinfo:
4+
description: 'Deletes a folder at the specified path.'
5+
cbparameters:
6+
parameters:
7+
- name: foldername
8+
typeName: string
9+
description: The name of the folder to delete.
10+
- name: folderpath
11+
typeName: string
12+
description: The path of the folder to delete.
13+
returns:
14+
signatureTypeName: Promise
15+
description: A promise that resolves with the server response.
16+
typeArgs:
17+
- type: reference
18+
name: DeleteFolderResponse
19+
data:
20+
name: deleteFolder
21+
category: fs
22+
link: deleteFolder.md
23+
---
24+
<CBBaseInfo/>
25+
<CBParameters/>
26+
27+
### Example
28+
29+
```js
30+
// Let's assume you want to delete a folder named "exampleFolder" in the /home/user/documents directory.
31+
32+
codebolt.fs.deleteFolder('exampleFolder', '/home/user/documents');

‎docs/api/fs/index.md

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
---
22
cbapicategory:
3-
- name: writeToFile
4-
link: /docs/api/fs/writeToFile
5-
description: 'Creates or updates a file and writes data to it.'
3+
- name: createFile
4+
link: /docs/api/fs/createFile
5+
description: 'Creates a new file with the specified name and content.'
6+
- name: createFolder
7+
link: /docs/api/fs/createFolder
8+
description: 'Creates a new folder at the specified location.'
69
- name: readFile
710
link: /docs/api/fs/readFile
811
description: 'Reads the contents of a file and returns it as a string.'
12+
- name: updateFile
13+
link: /docs/api/fs/updateFile
14+
description: 'Updates an existing file with new content.'
15+
- name: deleteFile
16+
link: /docs/api/fs/deleteFile
17+
description: 'Deletes a specified file from the filesystem.'
18+
- name: deleteFolder
19+
link: /docs/api/fs/deleteFolder
20+
description: 'Deletes a specified folder and its contents.'
921
- name: listFile
1022
link: /docs/api/fs/listFile
1123
description: 'Lists all files in the specified directory.'
@@ -15,8 +27,10 @@ cbapicategory:
1527
- name: searchFiles
1628
link: /docs/api/fs/searchFiles
1729
description: 'Searches for files matching a specific pattern or criteria.'
18-
19-
30+
- name: writeToFile
31+
link: /docs/api/fs/writeToFile
32+
description: 'Creates or updates a file and writes data to it.'
2033
---
34+
2135
# fs
22-
<CBAPICategory />
36+
<CBAPICategory />
+9-17
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,29 @@
11
---
22
name: listCodeDefinitionNames
33
cbbaseinfo:
4-
description: ' '
4+
description: 'Lists all code definition names in a given path.'
55
cbparameters:
66
parameters:
7-
- name: filePath
7+
- name: path
88
typeName: string
9-
description: The path of the file to update.
9+
description: The path to search for code definitions.
1010
returns:
1111
signatureTypeName: Promise
12-
description: A promise that resolves with the server response.
12+
description: A promise that resolves with the list of code definition names.
1313
typeArgs:
1414
- type: reference
15-
name: listCodeDefinitionNamesResponse
15+
name: ListCodeDefinitionNamesResponse
1616
data:
1717
name: listCodeDefinitionNames
1818
category: fs
1919
link: listCodeDefinitionNames.md
2020
---
2121
<CBBaseInfo/>
22-
<CBParameters/>
23-
24-
22+
<CBParameters/>
2523

2624
### Example
27-
```js
28-
2925

30-
let { success, result } = await codebolt.fs.listCodeDefinitionNames(path);
31-
32-
```
33-
34-
### Explaination
26+
```js
27+
// Let's assume you want to list all code definition names in the /home/user/projects directory.
3528

36-
The codebolt.fs.listCodeDefinitionNames method extract meaningful code definitions from a path source files
37-
returns success and result. as output.
29+
codebolt.fs.listCodeDefinitionNames('/home/user/projects');

‎docs/api/fs/listFile.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
---
22
name: listFile
33
cbbaseinfo:
4-
description: ' '
4+
description: 'Lists all files in a specified directory.'
55
cbparameters:
66
parameters:
77
- name: folderPath
88
typeName: string
9-
description: ''
9+
description: The path of the directory to list files from.
10+
- name: isRecursive
11+
typeName: boolean
12+
description: Whether to list files recursively.
1013
returns:
11-
signatureTypeName: void
12-
description: ' '
13-
typeArgs: []
14+
signatureTypeName: Promise
15+
description: A promise that resolves with the list of files.
16+
typeArgs:
17+
- type: reference
18+
name: FileListResponse
1419
data:
1520
name: listFile
1621
category: fs
1722
link: listFile.md
1823
---
1924
<CBBaseInfo/>
20-
<CBParameters/>
25+
<CBParameters/>
2126

2227
### Example
23-
```js
24-
25-
26-
let { success, result } = await codebolt.fs.listFile(path);
2728

28-
```
29-
30-
### Explaination
29+
```js
30+
// Let's assume you want to list all files in the /home/user/documents directory.
3131

32-
The listFiles function is designed to list files in a specified directory, with options for recursive listing and ignoring certain directories. Here's a summary of its functionality:
32+
codebolt.fs.listFile('/home/user/documents');

‎docs/api/fs/readFile.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
---
22
name: readFile
33
cbbaseinfo:
4-
description: ' '
4+
description: 'Reads the content of a file from the specified path.'
55
cbparameters:
66
parameters:
7-
- name: filename
8-
typeName: string
9-
description: The name of the file to read.
107
- name: filePath
118
typeName: string
129
description: The path of the file to read.
@@ -22,22 +19,11 @@ data:
2219
link: readFile.md
2320
---
2421
<CBBaseInfo/>
25-
<CBParameters/>
22+
<CBParameters/>
2623

2724
### Example
2825

2926
```js
30-
3127
// Let's assume you want to read the content of a file named example.txt in the /home/user/documents directory.
3228

33-
codebolt.fs.readFile('example.txt', '/home/user/documents');
34-
35-
```
36-
37-
### Explaination
38-
39-
The codebolt.fs.readFile method is used to read the content of a specified file from a given directory. It has two parameters:
40-
41-
filename (string): The name of the file to be read, including the file extension (e.g., "example.txt", "data.json").
42-
43-
filePath (string): The path to the directory where the file is located. It should be a valid path in the filesystem where you have read permissions.
29+
codebolt.fs.readFile('/home/user/documents/example.txt');

0 commit comments

Comments
 (0)
Failed to load comments.