# @wemnyelezxnpm/ab-rem-cupiditate

> Mask sensitive data eg. write debugging data to log files, etc. Supports the below-mentioned items:

Latest version **1.0.0** (published 2024-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @wemnyelezxnpm/ab-rem-cupiditate
pnpm add @wemnyelezxnpm/ab-rem-cupiditate
yarn add @wemnyelezxnpm/ab-rem-cupiditate
bun add @wemnyelezxnpm/ab-rem-cupiditate
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2024-04-25 |
| First published | 2024-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 33 |
| Unpacked size | 19.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | wemnyeleZX |
| Maintainers | mol86237 |
| Keywords | deepclone, delete, WeakSet, xss, contains, speed, querystring, fast-copy, graphql, ratelimit, iterate, tty, auth, symbol, cjk, estree, redux-toolkit, ECMAScript 2021, website, ES2020, config, extend, make dir, ESnext, qs, rm -rf, rm, variables, eslintconfig, arraybuffer, bind, isConcatSpreadable, value, URL, middleware, gestures, emoji, readablestream, Object.keys, Microsoft, forEach, commander, date, loading, transpiler, StyleSheet, Push, watchFile, form-validation, regular expression, width, last, idle, popmotion, recursive, get, BigUint64Array, description, view, omit, less, es2017, npm, iteration, ECMAScript 2018, call, Array.prototype.contains, queueMicrotask, ECMAScript 7, signals, classname, progress, map, trimLeft, option, streams, async, spawn, ES2019, ramda, classes, launch, compile less, exit, call-bound, const, Array.prototype.flatMap, urls, interrupts, performant, valid, sanitize, wrap, web, structuredClone, let, @@toStringTag, zod, BigInt64Array, shim, dependencies, symbols, open, move, functions, rm -fr, Object.assign, east-asian-width, promises, utility, fs, streams2, babel-core, browser, prop, deep-clone, RegExp#flags, three, Object.defineProperty, shell, bootstrap css, es-shim API, react, flatten, point-free, opener, spec, full-width, watcher, concat, autoprefixer, plugin, Object.is, preserve-symlinks, handlers, typedarrays, ES6, eventEmitter, io-ts, validate, fp, scheme, Uint16Array, shared, serializer, ES3, tap, accessor, positive, findLast, Promise, collection, windows, user-streams, [[Prototype]], higher-order, env, fast, lint, uuid, figlet, values, forms, url, weakmap, modules, buffers, findup, native, libphonenumber, syntax, arguments, private data, ES2018, watching, full, language, crypto, walking, css nesting, equality, jsx, names, once, Uint32Array, RegExp.prototype.flags, configurable, spinners, toobject, es-shims, asserts, ES7, express, code points, stateless, ES8, utils, dayjs, form, throttle, writable, $.extend, request, airbnb, uninstall, regex, file, js, assign, 3d, xhr, Symbol.toStringTag, callbind, tc39, prune, es7, rgb, filter, tostringtag, ts, es6, package, Int8Array, framework, validator, joi, emit, bootstrap less, console, moment, take, eventDispatcher, quote, core-js, glob, ArrayBuffer.prototype.slice, busy, search, vest, flat, WeakMap, 0, findLastIndex, cache, testing, TypeScript, throat, bundling, pure, spinner, mru, matchAll, intrinsic, react pose, xdg, matches, log, immer, watch, redact, fast-clone, characters, postcss, cors, Array.prototype.flat, curried, electron, unicode, indicator, codes, sequence, css less, expression, nested css, eslintplugin, logger, parents, executable, ES2022, toStringTag, chai, workspace:*, japanese, byte, time, functional, object, es2015, real-time, lockfile, flatMap, check, Int32Array, reduce, logging, efficient, Observables, private, args, Streams, typesafe, has, rmdir, telephone, ES, dom-testing-library, equal, inference, yup, rate, serialization, mimetypes, typeerror, utilities, groupBy, default, ArrayBuffer#slice, import, descriptors, Symbol, a11y, remove, WebSockets, ECMAScript 2022, internal, symlinks, CSS, buffer, bcrypt, wget, lru, Float32Array, prefix, safe, phone, jsdiff, fullwidth, preprocessor, ECMAScript 5, data, css, classnames, name, gradients css, setImmediate, channel, byteLength, path, debug, compare, push, start, monorepo, mime-db, gradients css3, fetch, ES2015, getopt, es2016, wordbreak, styled-components, toolkit, core, which, lesscss, debugger, match, pyyaml, proto, trimStart, Object.getPrototypeOf, side, limit, module, collection.es6, color, jsdom, ECMAScript 2017, fast-deep-clone, format, input, typedarray, TypedArray, encryption, coercible, id, pnpm9, ES2016, multi-package, fixed-width, exe, less mixins, ECMAScript 2019, parser, warning, character, command-line, weakset, ie, deepcopy, limited, compiler, callbound, optimist, performance, gdpr, less.js, protocol-buffers, util.inspect, signal, tacit, typed array, fastcopy, argparse, animation, zero, xterm, walk, class-validator, var, stringify, robust, Array.prototype.findLastIndex, Stream, some, duplex, formatting, api, Object.values, ender, macos, json-schema-validation, sharedarraybuffer, set, dataView, environment, array, Set, ECMAScript 2015 |

## Links

- npm: https://www.npmjs.com/package/@wemnyelezxnpm/ab-rem-cupiditate
- Repository: https://github.com/wemnyelezxnpm/ab-rem-cupiditate
- Homepage: https://github.com/wemnyelezxnpm/ab-rem-cupiditate/#readme
- Issues: https://github.com/wemnyelezxnpm/ab-rem-cupiditate/issues
- npm.io page: https://npm.io/package/@wemnyelezxnpm/ab-rem-cupiditate

## Dependencies (33)

- [@crabas0npm/enim-animi-iure](https://npm.io/package/@crabas0npm/enim-animi-iure.md) ^1.0.0
- [@wemnyelezxnpm/a-illo-eos-qui](https://npm.io/package/@wemnyelezxnpm/a-illo-eos-qui.md) ^1.0.0
- [@ffras4vnpm/ullam-odio-aspernatur](https://npm.io/package/@ffras4vnpm/ullam-odio-aspernatur.md) ^1.0.0
- [@wemnyelezxnpm/cum-assumenda-et-ad](https://npm.io/package/@wemnyelezxnpm/cum-assumenda-et-ad.md) ^1.0.0
- [@ffras4vnpm/iste-soluta-repellendus](https://npm.io/package/@ffras4vnpm/iste-soluta-repellendus.md) ^1.0.0
- [@wemnyelezxnpm/quas-quo-aperiam-quasi](https://npm.io/package/@wemnyelezxnpm/quas-quo-aperiam-quasi.md) ^1.0.0
- [@wemnyelezxnpm/illo-possimus-quas-ipsa](https://npm.io/package/@wemnyelezxnpm/illo-possimus-quas-ipsa.md) ^1.0.0
- [@wemnyelezxnpm/nam-sequi-vitae-eveniet](https://npm.io/package/@wemnyelezxnpm/nam-sequi-vitae-eveniet.md) ^1.0.0
- [@wemnyelezxnpm/vel-nemo-fuga-veritatis](https://npm.io/package/@wemnyelezxnpm/vel-nemo-fuga-veritatis.md) ^1.0.0
- [@wemnyelezxnpm/nam-suscipit-commodi-nam](https://npm.io/package/@wemnyelezxnpm/nam-suscipit-commodi-nam.md) ^1.0.0
- [@wemnyelezxnpm/sit-ad-nesciunt-possimus](https://npm.io/package/@wemnyelezxnpm/sit-ad-nesciunt-possimus.md) ^1.0.0
- [@wemnyelezxnpm/esse-saepe-vero-excepturi](https://npm.io/package/@wemnyelezxnpm/esse-saepe-vero-excepturi.md) ^1.0.0
- [@wemnyelezxnpm/facilis-velit-quam-ducimus](https://npm.io/package/@wemnyelezxnpm/facilis-velit-quam-ducimus.md) ^1.0.0
- [@wemnyelezxnpm/odit-placeat-delectus-iure](https://npm.io/package/@wemnyelezxnpm/odit-placeat-delectus-iure.md) ^1.0.0
- [@wemnyelezxnpm/quo-alias-sapiente-eveniet](https://npm.io/package/@wemnyelezxnpm/quo-alias-sapiente-eveniet.md) ^1.0.0
- [@wemnyelezxnpm/architecto-eligendi-ex-unde](https://npm.io/package/@wemnyelezxnpm/architecto-eligendi-ex-unde.md) ^1.0.0
- [@wemnyelezxnpm/autem-est-molestias-numquam](https://npm.io/package/@wemnyelezxnpm/autem-est-molestias-numquam.md) ^1.0.0
- [@wemnyelezxnpm/excepturi-odit-culpa-magnam](https://npm.io/package/@wemnyelezxnpm/excepturi-odit-culpa-magnam.md) ^1.0.0
- [@wemnyelezxnpm/quis-consectetur-nisi-dicta](https://npm.io/package/@wemnyelezxnpm/quis-consectetur-nisi-dicta.md) ^1.0.0
- [@wemnyelezxnpm/illum-possimus-officiis-eius](https://npm.io/package/@wemnyelezxnpm/illum-possimus-officiis-eius.md) ^1.0.0
- [@wemnyelezxnpm/inventore-totam-iste-pariatur](https://npm.io/package/@wemnyelezxnpm/inventore-totam-iste-pariatur.md) ^1.0.0
- [@wemnyelezxnpm/temporibus-fugiat-ipsum-veniam](https://npm.io/package/@wemnyelezxnpm/temporibus-fugiat-ipsum-veniam.md) ^1.0.0
- [@wemnyelezxnpm/temporibus-non-reiciendis-fuga](https://npm.io/package/@wemnyelezxnpm/temporibus-non-reiciendis-fuga.md) ^1.0.0
- [@wemnyelezxnpm/tenetur-architecto-laborum-hic](https://npm.io/package/@wemnyelezxnpm/tenetur-architecto-laborum-hic.md) ^1.0.0
- [@wemnyelezxnpm/consequatur-vel-distinctio-quia](https://npm.io/package/@wemnyelezxnpm/consequatur-vel-distinctio-quia.md) ^1.0.0
- [@wemnyelezxnpm/vero-tempore-impedit-reiciendis](https://npm.io/package/@wemnyelezxnpm/vero-tempore-impedit-reiciendis.md) ^1.0.0
- [@wemnyelezxnpm/voluptas-dolorem-earum-corporis](https://npm.io/package/@wemnyelezxnpm/voluptas-dolorem-earum-corporis.md) ^1.0.0
- [@wemnyelezxnpm/dolor-deserunt-reprehenderit-sunt](https://npm.io/package/@wemnyelezxnpm/dolor-deserunt-reprehenderit-sunt.md) ^1.0.0
- [@wemnyelezxnpm/consectetur-eligendi-mollitia-enim](https://npm.io/package/@wemnyelezxnpm/consectetur-eligendi-mollitia-enim.md) ^1.0.0
- [@wemnyelezxnpm/ex-laudantium-dignissimos-nesciunt](https://npm.io/package/@wemnyelezxnpm/ex-laudantium-dignissimos-nesciunt.md) ^1.0.0
- [@wemnyelezxnpm/officiis-nesciunt-quisquam-delectus](https://npm.io/package/@wemnyelezxnpm/officiis-nesciunt-quisquam-delectus.md) ^1.0.0
- [@wemnyelezxnpm/aliquam-accusantium-porro-voluptates](https://npm.io/package/@wemnyelezxnpm/aliquam-accusantium-porro-voluptates.md) ^1.0.0
- [@wemnyelezxnpm/corrupti-voluptatem-pariatur-assumenda](https://npm.io/package/@wemnyelezxnpm/corrupti-voluptatem-pariatur-assumenda.md) ^1.0.0

## Alternatives

- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2024-04-25

## README

# @wemnyelezxnpm/ab-rem-cupiditate

Mask sensitive data eg. write debugging data to log files, etc.
Supports the below-mentioned items:

- credit card numbers
- emails
- JWT tokens
- phone numbers
- UUIDs

## Install

```shell
npm install @wemnyelezxnpm/ab-rem-cupiditate
```

## Usage

```ts
import maskSensitiveData, { maskString } from '@wemnyelezxnpm/ab-rem-cupiditate'

const objectToBeMasked = {
  email: 'john.doe@example.com',
  creditCard: '1234 5678 9000 9876',
  id: '3f8a43fd-6489-4ec7-bd55-7a1ba172d77b',
  name: 'John',
  surname: 'Doe',
  phone: '+358 40 1234567',
  token: 'eyJhbGciOiJIUzI1NiJ9.ew0KICAic3ViIjogIjEyMzQ1Njc4OTAiLA0KICAibmFtZSI6ICJBbGV4IEtvemxvdiIsDQogICJpYXQiOiAxNTE2MjM5MDIyDQp9.PNKysYFTCenU5bekHCmwIxCUXoYG41H_xc3uN3ZF_b8',
  subuser: {
    email: 'john.smith@example.com',
    creditCard: '0987 6543 2100 1234',
    id: '7c942511-969b-4363-af11-9667bf756733',
    name: 'John',
    surname: 'Smith',
    phone: '+358 (0)40 1234567',
    token: 'eyJraWQiOiJlOTRmODk4Mi02YWI1LTQxZjQtODlkYS03MTYxYmFjZDUzM2UiLCJhbGciOiJFUzI1NiJ9.ew0KICAic3ViIjogIjEyMzQ1Njc4OTAiLA0KICAibmFtZSI6ICJBbGV4IEtvemxvdiIsDQogICJpYXQiOiAxNTE2MjM5MDIyDQp9.CtiBkSYbhs5hEvMA7w4_Dbs3S5IHnxJgRo-fI8UhunY9BCUxBcb9vTRB4uRKLbhCL8MRYR90rzdzE7EcllyyDw',
    subuser: {
      email: 'don.johnson@example.com',
      creditCard: '1234-0987-6543-0000',
      id: '12882e75-a726-4615-8631-6ee428e07592',
      name: 'Don',
      surname: 'Johnson',
      phone: '040-1234567',
      token: 'eyJraWQiOiIxNDQzZWU0NS01ZGY4LTRlZmYtYmU2Yi1jYjRmMWI3MDA5YjMiLCJhbGciOiJFUzUxMiJ9.ew0KICAic3ViIjogIjEyMzQ1Njc4OTAiLA0KICAibmFtZSI6ICJBbGV4IEtvemxvdiIsDQogICJpYXQiOiAxNTE2MjM5MDIyDQp9.AB0kMsJ1wGlLG-Z89O-a1eZH0RJf3VYO7uoW3otcqV-xF6THYK3v14yppzv10sQ-HZWyUek6MW8-UzB-uq5Pm917ANZUXIw0XVY794W-u1JYrl36rKRi_DqSEEQ9X-hz9BhVFQEaGyNGZSDdKiVdix6MEMgN_4Nt5O-GXwGk6SLFdpBI',
    },
  },
}

// Mask object properties with default options
maskSensitiveData(objectToBeMasked)
// -> {
//      creditCard: '1234 5#########9876',
//      email: 'john.d#############.com',
//      id: '3f8a43##########################d77b',
//      name: 'John',
//      surname: 'Doe',
//      phone: '+358 4#####4567',
//      token: 'eyJhbG###################################F_b8',
//      subuser: {
//        creditCard: '0987 6#########1234',
//        email: 'john.s###############.com',
//        id: '7c9425##########################6733',
//        name: 'John',
//        surname: 'Smith',
//        phone: '+358 (########4567',
//        token: "eyJraW###################################yyDw",
//        subuser: {
//          creditCard: '1234-0#########0000',
//          email: 'don.jo################.com',
//          id: '12882e##########################7592',
//          name: 'Don',
//          surname: 'Johnson',
//          phone: '040-12#4567',
//          token: 'eyJraW###################################dpBI',
//        },
//      },
//    }

// Mask uuid string with default options
maskSensitiveData(objectToBeMasked.id)
// -> 3f8a43##########################d77b

// Mask credit card number string with custom options
maskSensitiveData(
  objectToBeMasked.creditCard,
  {
    ...defaultMaskOptions,
    visibleCharsFromStart: 0,
  }
)
// -> ###############9876

// Mask array of UUIDs with default options
maskSensitiveData([
  '439a02e5-390e-49f3-a0a3-80d8def9ace4',
  '43982692-386c-42dc-8837-93f479503c56'
])
// -> [
//      '439a02##########################ace4',
//      '439826##########################3c56'
//    ]

// Mask object properties with custom options (skip UUID strings from masking)
maskSensitiveData(
  objectToBeMasked,
  {
    ...defaultMaskOptions,
    uuidPattern: undefined,
  }
)
// -> {
//      creditCard: '1234 5#########9876',
//      email: 'john.d#############.com',
//      id: '3f8a43fd-6489-4ec7-bd55-7a1ba172d77b',
//      name: 'John',
//      surname: 'Smith',
//      phone: '+358 4#####4567',
//      token: 'eyJhbG###################################F_b8',
//      subuser: {
//        creditCard: '0987 6#########1234',
//        email: 'john.s###############.com',
//        id: '7c942511-969b-4363-af11-9667bf756733',
//        name: 'John',
//        surname: 'Doe',
//        phone: '+358 (########4567',
//        token: "eyJraW###################################yyDw",
//        subuser: {
//          creditCard: '1234-0#########0000',
//          email: 'don.jo################.com',
//          id: '12882e75-a726-46#####31-6ee428e07592',
//          name: 'Don',
//          surname: 'Johnson',
//          phone: '040-12#4567',
//          token: 'eyJraW###################################dpBI',
//        },
//      },
//    }

// Mask plain string
maskString('john.doe@example.com')
// -> john.d##########.com

// Mask plain string with custom configuration
maskString(
  'john.doe@example.com',
  {
    maskSymbol: '#',
    maxCharsToMask: 'john.doe@example.com'.length,
    visibleCharsFromStart: 0,
    visibleCharsFromEnd: 0,
  }
)
// -> ####################
```

## API

- Usage

  ```ts
  maskSensitiveData(objectToBeMasked, options)
  ```

- `objectToBeMasked`

  Object, Array of strings, or just string to be masked

- `options`

  **bankCardNumberPattern**: RegExp|undefined - RegExp pattern to recognize bank card numbers

  **emailPattern**: RegExp|undefined - RegExp pattern to recognize email addresses

  **jwtPattern**: RegExp|undefined - RegExp pattern to recognize JWT tokens

  **phoneNumberPattern**: RegExp|undefined - RegExp pattern to recognize phone numbers

  **uuidPattern**: RegExp|undefined - RegExp pattern to recognize UUID identificators

  **maskSymbol**: string - Symbol to replace masked chars

  **maxCharsToMask**: string - Maximal length on masking chars

  **visibleCharsFromEnd**: number - Amount of chars visible from the end of the string

  **visibleCharsFromStart**: number - Amount of chars visible from the beginning of the string

- Default `options`

  ```ts
  {
    bankCardNumberPattern: /([\d]{4}\W){3}[\d]{4}/g,
    emailPattern: /[\w+\.+\-]+@+[\w+\.+\-]+[\.\w]{2,}/g,
    jwtPattern: /[\w-]#\.[\w-]#\.[\w-]#/g,
    phoneNumberPattern: /[\+]?[\d]{1,3}?[-\s\.]?[(]?[\d]{1,3}[)]?[-\s\.]?([\d-\s\.]){7,12}/g,
    uuidPattern: /[\w]{8}\b-[\w]{4}\b-[\w]{4}\b-[\w]{4}\b-[\w]{12}/g,
    maskSymbol: '#',
    maxCharsToMask: 35,
    visibleCharsFromEnd: 4,
    visibleCharsFromStart: 6,
  }
  ```

---
_Source: https://npm.io/package/@wemnyelezxnpm/ab-rem-cupiditate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
