@@ -28,7 +28,7 @@ Continue with [learning about the API](#api).
2828### Web
2929- Load HSSP for JavaScript with:
3030``` html
31- <script src =" https://cdn.jsdelivr.net/npm/hssp@3 /web.min.js" ></script >
31+ <script src =" https://cdn.jsdelivr.net/npm/hssp@4 /web.min.js" ></script >
3232```
3333- Create an editor:
3434``` js
@@ -62,6 +62,7 @@ editor.addFile('my-folder/test.txt', fs.readFileSync('test2.txt'));
6262editor .addFile (' my-folder/test.txt' , (new TextEncoder ()).encode (' Hello, world! 2' ).buffer );
6363```
6464- Delete a file:
65+
6566** Note:** _ This method will return the file Buffer/ArrayBuffer._
6667``` js
6768editor .remove (' test.txt' );
@@ -70,6 +71,7 @@ editor.remove('test.txt');
7071``` js
7172editor .remove (' my-folder' );
7273```
74+
7375** Note:** _ This will only remove the folder, not the files in it! If you want to remove the folder with the files in it, use:_
7476``` js
7577var folderName = ' my-folder' ;
@@ -85,7 +87,7 @@ editor.remove(folderName); // Remove the folder itself
8587
8688- Set output file version:
8789``` js
88- editor .version = 4 ; // 4 is set by default, 1-4 are valid version numbers
90+ editor .version = 5 ; // 5 is set by default, 1-5 are valid version numbers
8991```
9092- Enable output encryption:
9193``` js
@@ -96,6 +98,7 @@ editor.password = 'MySecretPassword'; // write-only
9698editor .password = null ; // Encryption is disabled by default
9799```
98100- Enable output compression ([ Supported algorithms] ( #supported-compression-algorithms ) ):
101+
99102** Note:** _ Requires editor.version is 4 or higher._
100103``` js
101104editor .compression = { algorithm: ' LZMA' , level: 9 }; // Level default is 5
@@ -105,14 +108,15 @@ editor.compression = { algorithm: 'LZMA', level: 9 }; // Level default is 5
105108editor .compression = null ; // default
106109```
107110- Add a comment:
111+
108112** Note:** _ Requires editor.version is 4 or higher. The comment can be up to 16 characters (UTF-8) long._
109113``` js
110114editor .comment = ' Hello :)' ;
111115```
112116
113117#### Importing HSSP files
114118
115- Currently supports HSSP 1-4 .
119+ Currently supports HSSP 1-5 .
116120
117121- Importing HSSP files _ without_ encryption:
118122``` js
@@ -145,7 +149,7 @@ document.querySelector('input[type=file]').onchange = async (ev) => {
145149
146150#### Creating HSSP files
147151
148- Currently supports HSSP 1-4 .
152+ Currently supports HSSP 1-5 .
149153
150154- Creating _ one_ file:
151155``` js
@@ -162,6 +166,7 @@ a.click();
162166URL .revokeObjectURL (url);
163167```
164168- Creating _ multiple_ files:
169+
165170** Note:** _ This method can only be used if ` editor.version ` is 4 or higher. You also cannot create more files than bytes included._
166171``` js
167172// Node
@@ -185,7 +190,7 @@ editor.toBuffers(4).forEach((buf, i) => {
185190
186191#### Fetching metadata from HSSP file
187192
188- Currently supports HSSP 1-4 .
193+ Currently supports HSSP 1-5 .
189194
190195Fetching metadata is as simple as that:
191196``` js
@@ -236,7 +241,7 @@ editor.addFolder(name, options);
236241
237242Feel free to contribute by [ opening an issue] ( https://github.com/HSSPfile/js/issues/new/choose ) and requesting new features, reporting bugs or just asking questions.
238243
239- You can also [ fork the repository] ( https://github.com/HSSPfile/js/fork ) and opening a [ pull request] ( https://github.com/HSSPfile/js/pulls ) after making some changes like fixing bugs.
244+ You can also [ fork the repository] ( https://github.com/HSSPfile/js/fork ) and open a [ pull request] ( https://github.com/HSSPfile/js/pulls ) after making some changes like fixing bugs.
240245
241246## [ License] ( LICENSE )
242247
0 commit comments