# @codexcentral/mask-text-to-symbol

> Takes a string as input and returns a new string with all characters replaced by an specified symbol.

Latest version **1.1.0** (published 2023-12-21) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @codexcentral/mask-text-to-symbol
pnpm add @codexcentral/mask-text-to-symbol
yarn add @codexcentral/mask-text-to-symbol
bun add @codexcentral/mask-text-to-symbol
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2023-12-21 |
| First published | 2023-12-21 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 17.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Roberto Silva Zuñiga |
| Maintainers | roberto.silva |
| Keywords | typescript, string, replace, text, mask, password, javascript, node |

## Links

- npm: https://www.npmjs.com/package/@codexcentral/mask-text-to-symbol
- Repository: https://github.com/Codex-Central/mask-text-to-symbol
- Homepage: https://github.com/Codex-Central/mask-text-to-symbol#readme
- Issues: https://github.com/Codex-Central/mask-text-to-symbol/issues
- npm.io page: https://npm.io/package/@codexcentral/mask-text-to-symbol

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2023-12-21
- 1.0.0 — 2023-12-21

## README

# mask-text-to-symbol

Takes a string as input and returns a new string with all characters replaced by an specified symbol.

## Installation

> `npm install @codexcentral/mask-text-to-symbol`

## Usage

### 1. Importing...

```javascript
import { maskTextToSymbol } from "@codexcentral/mask-text-to-symbol";
```

### 2. Call the functions

#### Example with default symbol

```javascript
  const text = "password";
  const password = maskTextToSymbol({ text });
  console.log(password);
  // { original: 'password', masked: '********' }
```

#### Example with symbol

```javascript
  const text = 'password';
  const password = maskTextToSymbol({ text, symbol: 'a' });
  console.log(password);
  // { original: 'password', masked: 'aaaaaaaa'}
```

### Attributes

| Attribute  | Type     | Mandatory                               |
| ---------- | -------- | --------------------------------------- |
| text | `string` | true                                    |
| symbol | `number` | false (default: `*`)                       |



## Wrapper function as a Helper (optional)
### 1. Import the function

```javascript
import { maskTextToSymbol, TMaskTextToSymbol } from "@codexcentral/mask-text-to-symbol";
```

### 2. Create the Helper function

```javascript
const maskTextToSymbolHelper = ({ text, symbol }: TMaskTextToSymbol) => {
  return maskTextToSymbol({ text, symbol });
};
```



# Credits

These code was written by [Roberto Silva Z.](https://www.linkedin.com/in/robertosilvazuniga/)

---
_Source: https://npm.io/package/@codexcentral/mask-text-to-symbol · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
