Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lmfresneda/hashtagfy

Convert any text to #hashtag
https://github.com/lmfresneda/hashtagfy

hashtag hashtags tag tags twitter

Last synced: 6 days ago
JSON representation

Convert any text to #hashtag

Awesome Lists containing this project

README

        

# hashtagfy
[![npm](https://img.shields.io/npm/v/hashtagfy.svg?style=flat-square)](https://www.npmjs.com/package/hashtagfy) ![Love](https://img.shields.io/badge/love-max-brightgreen.svg?style=flat-square) [![Travis](https://img.shields.io/travis/lmfresneda/hashtagfy.svg?style=flat-square)](https://travis-ci.org/lmfresneda/hashtagfy)

Convert any text to #hashtag

## How to use

```javascript
const hashtagfy = require('hashtagfy')

const hashtag1 = hashtagfy('Any text');
// hashtag1 == '#AnyText'

const hashtag2 = hashtagfy('Similar-text_more');
// hashtag2 == '#SimilarTextMore'

const hashtag3 = hashtagfy('And the last', { capitalize: false });
// hashtag3 == '#andthelast'
```

NOTE: The `capitalize` option is optional. Is `true` by default.

## Run test

```
$ npm install && npm test
```

## License

MIT © [lmfresneda](https://github.com/lmfresneda)