spd-lib 1.0.6 → 1.0.7
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.
- package/index.js +1 -1
- package/package.json +2 -4
- package/readme.md +5 -5
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spd-lib",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "SPD or Secure Packaged Data is a compress PQC protected file format to
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"description": "SPD or Secure Packaged Data is a compress PQC protected file format to store sensitive data localy",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -21,8 +21,6 @@
|
|
|
21
21
|
"author": "ALS-OPSS",
|
|
22
22
|
"license": "ISC",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"crypto": "^1.0.1",
|
|
25
|
-
"fs": "^0.0.1-security",
|
|
26
24
|
"libsodium-wrappers": "^0.7.13"
|
|
27
25
|
}
|
|
28
26
|
}
|
package/readme.md
CHANGED
|
@@ -21,13 +21,13 @@ const { SPD } = require('spd-lib');
|
|
|
21
21
|
|
|
22
22
|
const passcode = 'your-secure-passcode';
|
|
23
23
|
const spd = new SPD(); // Create a new SPD object // Set the passcode to the SPD object
|
|
24
|
-
await spd.setPassKey(passcode); //
|
|
25
|
-
await spd.addData('settings', '{"theme":"dark"}'); // Add a
|
|
26
|
-
await spd.addData('tabs', '[{"title":"Home","url":"https://example.com"},{"title":"About","url":"https://example.com/about"}]'); // Add
|
|
24
|
+
await spd.setPassKey(passcode); // Set Passkey
|
|
25
|
+
await spd.addData('settings', '{"theme":"dark"}'); // Add a data to the SPD object
|
|
26
|
+
await spd.addData('tabs', '[{"title":"Home","url":"https://example.com"},{"title":"About","url":"https://example.com/about"}]'); // Add more data to the SPD object
|
|
27
27
|
spd.saveToFile('output.spd'); // Save SPD file to disk with the salt
|
|
28
28
|
const loadedSpd = await SPD.loadFromFile('output.spd', passcode); // Load SPD file with the passcode
|
|
29
|
-
const
|
|
30
|
-
console.log(
|
|
29
|
+
const extractedData = await loadedSpd.extractData(); // Extract data to memory
|
|
30
|
+
console.log(extractedData); // Print extracted files to console
|
|
31
31
|
})();
|
|
32
32
|
```
|
|
33
33
|
|