Namespace, Primitive, Method

    hide-sensitive-keys

    1.0.1 • Public • Published

    hide sensitive keys

    Hide sensitive keys from a string or from a json payload. It acceptes a string or a JSON payload.

    Usage

    var HideSenSitiveKeys = require('hide-sensitive-keys');
    const hidesensitivekeys = new HideSenSitiveKeys({sensitiveKeys: ['password','cardNumber']});
    //-hiding keys and return new payload/string.
     var data = hidesensitivekeys.hide({payload:{username:'ali_142', password: '415145'}});
     

    API

    new HideSenSitiveKeys(sensitiveKeys)

    • constructor, You have to pass a list of sensitive keys in the constructor you are using in your project. It's optional.

    HideSenSitiveKeys#hideSensitiveKeys = function(sensitiveKeys)

    • sensitiveKeys You can pass sensitive keys later as well.

    HideSenSitiveKeys#hideKey = function(key)

    • key, a single key can be set on run time.

    Todo

    • Tests

    Install

    npm i hide-sensitive-keys

    DownloadsWeekly Downloads

    5

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    2.43 kB

    Total Files

    3

    Last publish

    Collaborators

    • bilal_metla