JSPM

data-masking

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 43
  • Score
    100M100P100Q83514F
  • License ISC

a package for data masking

Package Exports

  • data-masking

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (data-masking) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

data-mask

a package for data masking

Installation

$ npm install data-mask

Usage

/**
 * options parameter is optional in the constructor.
 */
const { masking, show } = require('data-masking');

// Cover character
masking('17612345678', 3, 7); // 176****5678
masking('17612345678', -1, 11) // 1761234567*
masking('17612345678', 3, 7, '#'); // 176####5678

// Select show character
show('张三丰', 0, 1); // 张**
show('张三丰', -1); // **丰
show('张三丰', 0, 1, '#'); // 张##

License

Copyright (c) 2019 Hosea, Licensed under the MIT license.