1.0.2 • Published 7 years ago
wiseplat-keyfile-recognizer v1.0.2
wiseplat-keyfile-recognizer
Checks for structural sanity (key-names and value-types) of json
-keyfiles.
Currently recognized keyfiles:
- Wisesale
- web3-secret-storage (v3)
- scrypt
- pbkdf2
Installation
npm install --save wiseplat-keyfile-recognizer
Usage
var fs = require('fs');
var recognizer = require('wiseplat-keyfile-recognizer');
fs.readFile('keyfile.json', (err, data) => {
var json = JSON.parse(data);
var result = recognizer(json);
/** result
* [ 'web3', 3 ] web3 (v3) keyfile
* [ 'wisesale', undefined ] Wisesale keyfile
* null no valid keyfile
*/
}));
Development
To build and run the tests:
$ npm install
$ npm test
Contributions
Contributions welcome - see CONTRIBUTING.md
License
MIT - see LICENSE.md
1.0.2
7 years ago