# is-secret

> A distributed maintained collection of patterns that indicate that something probably is secret

Latest version **1.2.1** (published 2018-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-secret
pnpm add is-secret
yarn add is-secret
bun add is-secret
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2018-10-27 |
| First published | 2016-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/is-secret) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19 |
| Author | Thomas Watson Steen |
| Maintainers | watson |
| Keywords | secret, validate, redact, protect, filter |

## Links

- npm: https://www.npmjs.com/package/is-secret
- Repository: https://github.com/watson/is-secret
- Homepage: https://github.com/watson/is-secret#readme
- Issues: https://github.com/watson/is-secret/issues
- npm.io page: https://npm.io/package/is-secret

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2018-10-27
- 1.2.0 — 2018-10-27
- 1.1.1 — 2016-12-14
- 1.1.0 — 2016-12-14
- 1.0.2 — 2016-11-22
- 1.0.1 — 2016-11-21
- 1.0.0 — 2016-11-15

## README

# is-secret

A distributed maintained collection of patterns that indicate that
something probably is secret.

This is useful if you want to filter sensitive values in a data set.

This module uses a very simple algorithm that will not catch everthing.
Use at your own risk.

[![npm](https://img.shields.io/npm/v/is-secret.svg)](https://www.npmjs.com/package/is-secret)
[![Build status](https://travis-ci.org/watson/is-secret.svg?branch=master)](https://travis-ci.org/watson/is-secret)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

## Installation

```
npm install is-secret --save
```

## Usage

```js
var isSecret = require('is-secret')

var data = {
  username: 'watson',
  password: 'f8bY2fg8',
  card: '1234 1234 1234 1234' // credit card number
}

Object.keys(data).forEach(function (key) {
  if (isSecret.key(key) ||
      isSecret.value(data[key])) data[key] = '********'
})

console.log(data)
// {
//   username: 'watson',
//   password: '********',
//   card: '********'
// }
```

_If you need functionality similar to what is shown in this example, I
suggest you take a look at the
[redact-secrets](https://github.com/watson/redact-secrets) module._

## API

### `secret.key(string)`

Validates the given `string` against a list of key names known to
typically indicate secret data.

Returns `true` if the `string` is considered secret. Otherwise `false`.

### `secret.value(string)`

Validates the given `string` against a list of patterns that indicates
secret data.

Returns `true` if the `string` is considered secret. Otherwise `false`.

## License

[MIT](LICENSE)

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