# hashtag-parser

> Get an array of hashtags extracted from a string

Latest version **1.0.4** (published 2022-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install hashtag-parser
pnpm add hashtag-parser
yarn add hashtag-parser
bun add hashtag-parser
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2022-10-17 |
| First published | 2022-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Rajdeep Ghosh |
| Maintainers | rajdeepghosh |
| Keywords | hashtag, parser, extract, string, hashtag parser, hashtag extract |

## Links

- npm: https://www.npmjs.com/package/hashtag-parser
- Repository: https://github.com/rajdeep-ghosh/hashtag-parser
- Homepage: https://github.com/rajdeep-ghosh/hashtag-parser#readme
- Issues: https://github.com/rajdeep-ghosh/hashtag-parser/issues
- npm.io page: https://npm.io/package/hashtag-parser

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2022-10-17
- 1.0.3 — 2022-10-17
- 1.0.2 — 2022-09-18
- 1.0.1 — 2022-09-18
- 1.0.0 — 2022-09-13

## README

# Hashtag Parser
Get an array of hashtags extracted from a string


# Usage
```javascript
import extract from "hashtag-parser";

const hashtags = extract("Any text with #hashtag");

// hashtags = ["#hashtag"]
```

# The extract() function
Parameters
- String
- Options (Object) | Optional
  - symbol | Boolean
  - unique | Boolean
  - caseSensitive | Boolean

Returns
- Array

# Options
## Remove # symbol
```javascript
const hashtags = extract("Any text with #hashtag", { symbol: false });

// hashtags = ["hashtag"]
```

## Get unique values
```javascript
const hashtags = extract("Any text with #hashtag and another #hashtag", {
  symbol: true, unique: true
});

// hashtags = ["#hashtag"]
```

## Include case sensitive tags
```javascript
const hashtags = extract("Any text with #hashtag and another #Hashtag", {
  symbol: false, unique: true, caseSensitive: true
});

// hashtags = ["hashtag", "Hashtag"]
```

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