# get-symbol-description

> Gets the description of a Symbol. Handles `Symbol()` vs `Symbol('')` properly when possible.

Latest version **1.1.0** (published 2024-12-17) · MIT license · 0 weekly downloads

> **Native alternative:** Symbol.prototype.description — Use native JavaScript (Node 11.0.0+) (https://developer.mozilla.orgGlobal_Objects/Symbol/description)

## Install

```sh
npm install get-symbol-description
pnpm add get-symbol-description
yarn add get-symbol-description
bun add get-symbol-description
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2024-12-17 |
| First published | 2021-08-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 0.4 |
| Dependencies | 3 |
| Unpacked size | 16.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Jordan Harband |
| Maintainers | ljharb |
| Keywords | symbol, ecmascript, javascript, description |

## Links

- npm: https://www.npmjs.com/package/get-symbol-description
- Repository: https://github.com/inspect-js/get-symbol-description
- Homepage: https://github.com/inspect-js/get-symbol-description#readme
- Issues: https://github.com/inspect-js/get-symbol-description/issues
- Funding: https://github.com/sponsors/ljharb
- npm.io page: https://npm.io/package/get-symbol-description

## Dependencies (3)

- [es-errors](https://npm.io/package/es-errors.md) ^1.3.0
- [call-bound](https://npm.io/package/call-bound.md) ^1.0.3
- [get-intrinsic](https://npm.io/package/get-intrinsic.md) ^1.2.6

## Recent versions

- 1.1.0 (latest) — 2024-12-17
- 1.0.2 — 2024-02-07
- 1.0.1 — 2024-02-06
- 1.0.0 — 2021-08-17

## README

# get-symbol-description <sup>[![Version Badge][2]][1]</sup>

[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][11]][1]

Gets the description of a Symbol. Handles `Symbol()` vs `Symbol('')` properly when possible.

## Example

```js
var getSymbolDescription = require('get-symbol-description');
var assert = require('assert');

assert(getSymbolDescription(Symbol()) === undefined);
assert(getSymbolDescription(Symbol('')) === ''); // or `undefined`, if in an engine that lacks name inference from concise method
assert(getSymbolDescription(Symbol('foo')) === 'foo');
assert(getSymbolDescription(Symbol.iterator) === 'Symbol.iterator');
```

## Tests
Simply clone the repo, `npm install`, and run `npm test`

[1]: https://npmjs.org/package/get-symbol-description
[2]: https://versionbadg.es/inspect-js/get-symbol-description.svg
[5]: https://david-dm.org/inspect-js/get-symbol-description.svg
[6]: https://david-dm.org/inspect-js/get-symbol-description
[7]: https://david-dm.org/inspect-js/get-symbol-description/dev-status.svg
[8]: https://david-dm.org/inspect-js/get-symbol-description#info=devDependencies
[11]: https://nodei.co/npm/get-symbol-description.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/get-symbol-description.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/get-symbol-description.svg
[downloads-url]: https://npm-stat.com/charts.html?package=get-symbol-description
[codecov-image]: https://codecov.io/gh/inspect-js/get-symbol-description/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/get-symbol-description/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/get-symbol-description
[actions-url]: https://github.com/inspect-js/get-symbol-description/actions

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