https://github.com/wiseplat/npm2-wiseplat-keyfile-recognizer
Checks for valid structure of wiseplat web3-secret-storage/presale keyfiles
https://github.com/wiseplat/npm2-wiseplat-keyfile-recognizer
Last synced: 12 months ago
JSON representation
Checks for valid structure of wiseplat web3-secret-storage/presale keyfiles
- Host: GitHub
- URL: https://github.com/wiseplat/npm2-wiseplat-keyfile-recognizer
- Owner: WISEPLAT
- License: lgpl-3.0
- Created: 2018-04-24T11:01:52.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-24T11:02:46.000Z (over 8 years ago)
- Last Synced: 2025-02-18T10:17:07.931Z (over 1 year ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md_
- License: LICENSE
Awesome Lists containing this project
README
# npm2-wiseplat-keyfile-recognizer
[](https://travis-ci.org/wiseplat/npm2-wiseplat-keyfile-recognizer)
Checks for structural sanity (key-names and value-types) of `json`-keyfiles.
Currently recognized keyfiles:
- Wisesale
- [web3-secret-storage](https://github.com/wiseplat/wiki/wiki/Web3-Secret-Storage-Definition) (v3)
- scrypt
- pbkdf2
## Installation
```shell
npm install --save npm2-wiseplat-keyfile-recognizer
```
## Usage
```javascript
var fs = require('fs');
var recognizer = require('npm2-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 invalid keyfile
*/
}));
```
## Development
To build and run the tests:
```shell
$ npm install
$ npm test
```
## Contributions
Contributions welcome - see [CONTRIBUTING.md](CONTRIBUTING.md)
## License
MIT - see [LICENSE.md](LICENSE.md)