npm-wiseplat-keyfile-recognizer

1.0.2 • Public • Published

npm-wiseplat-keyfile-recognizer

Build Status

Checks for structural sanity (key-names and value-types) of json-keyfiles.

Currently recognized keyfiles:

Installation

npm install --save npm-wiseplat-keyfile-recognizer

Usage

var fs = require('fs');
var recognizer = require('npm-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:

$ npm install
$ npm test

Contributions

Contributions welcome - see CONTRIBUTING.md

License

MIT - see LICENSE.md

/npm-wiseplat-keyfile-recognizer/

    Package Sidebar

    Install

    npm i npm-wiseplat-keyfile-recognizer

    Weekly Downloads

    4

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    8.51 kB

    Total Files

    8

    Last publish

    Collaborators

    • wiseplat