@drifted/raven 0.0.5 → 0.0.8

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/bin/cli.js CHANGED
@@ -8,7 +8,7 @@ const JSONDataFile = require(path.join(__dirname, '..'));
8
8
 
9
9
 
10
10
  var parser = new CarrierPigeon({strict: true});
11
- parser.commands('usage', 'show', 'secret', 'init', 'generate', 'expose', 'conceal', 'encrypt', 'decrypt');
11
+ parser.commands('version', 'usage', 'show', 'secret', 'init', 'generate', 'expose', 'conceal', 'encrypt', 'decrypt');
12
12
  parser.option('file', {type: 'file'});
13
13
  parser.option('secret', {});
14
14
  parser.option('data', {});
@@ -165,3 +165,11 @@ if (command == 'usage') {
165
165
  }
166
166
 
167
167
 
168
+
169
+ if (command == 'version') {
170
+ var data = fs.readFileSync(path.join(__dirname, '..', 'package.json')).toString();
171
+ var json = JSON.parse(data);
172
+ console.log(json.version)
173
+ }
174
+
175
+
package/index.js CHANGED
@@ -19,7 +19,7 @@ class RavenDataFile {
19
19
  this.algorithm = 'aes-256-gcm';
20
20
  }
21
21
 
22
- if (this.secret == undefined && JSONDataFile.hasFile()) {
22
+ if (this.secret == undefined && RavenDataFile.hasFile()) {
23
23
  this.populateSecretFromFile();
24
24
  }
25
25
 
@@ -29,7 +29,7 @@ class RavenDataFile {
29
29
  }
30
30
 
31
31
  populateSecretFromFile() {
32
- var data = fs.readFileSync(JSONDataFile.secretFile()).toString();
32
+ var data = fs.readFileSync(RavenDataFile.secretFile()).toString();
33
33
  var json = JSON.parse(data);
34
34
  this.secret = json.secret;
35
35
  }
@@ -47,7 +47,7 @@ class RavenDataFile {
47
47
  }
48
48
 
49
49
  return new Promise(async(resolve) => {
50
- var file = new JSONDataFile(options);
50
+ var file = new RavenDataFile(options);
51
51
  var times = 0;
52
52
 
53
53
  await file.read();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drifted/raven",
3
- "version": "0.0.5",
3
+ "version": "0.0.8",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/driftless-group/raven",
6
6
  "bin": {
@@ -15,9 +15,7 @@
15
15
  "type": "commonjs",
16
16
  "main": "index.js",
17
17
  "scripts": {
18
- "test": "mocha -w",
19
- "encrypt": "./bin/file.js encrypt",
20
- "decrypt": "./bin/file.js decrypt"
18
+ "test": "mocha -w"
21
19
  },
22
20
  "devDependencies": {
23
21
  "@drifted/qa": "^0.0.5"
File without changes