[go: up one dir, main page]

masked

1.2.1 • Public • Published

Masked Build Status

Mask sensitive values in a collection

Install

$ npm install masked

Usage

import masked from 'masked';
 
const user = {
  firstName: 'jake',
  password: 'IAmCool',
  mobileNumbers: ['0400123123', '0411223444'],
  providerData: [{ providerNumber: '123456' }, { providerNumber: '123456' }]
};
 
const maskedUser = masked(user, ['password', 'mobileNumbers', 'providerData']);
/*
maskedUser =
  {
    firstName: 'jake',
    password: '********',
    mobileNumbers: ['********', '********'],
    providerData: [{ providerNumber: '********' }, { providerNumber: '********' }]
  }
*/

and here

API

masked(data, keys[, opts])

data

Type: Object or Array<Object>

The data that you want to mask.

keys

Type: string or Array

The sensitive keys in your data.

opts

omitKeys

Type: boolean

Default value: false

If true, it will omit the keys completely from the data.

License

MIT © jxom

Readme

Keywords

Package Sidebar

Install

npm i masked

Weekly Downloads

3,589

Version

1.2.1

License

MIT

Unpacked Size

6.15 kB

Total Files

4

Last publish

Collaborators

  • jmoxey