npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

collect-mentions

v1.0.2

Published

Collect mentions from a given text string, using battle-tested `mentions-regex` package

Downloads

2,630

Readme

collect-mentions npm version github release License

Collect mentions from a given text string, using battle-tested mentions-regex package

XAXA code style CircleCI linux build CodeCov coverage status DavidDM dependency status Renovate App Status Make A Pull Request Semantically Released

If you have any how-to kind of questions, please read the Contributing Guide and Code of Conduct documents.
For bugs reports and feature requests, please create an issue or ping @tunnckoCore at Twitter.

Conventional Commits PayPal Author Support Share Love Tweet NPM Downloads Weekly NPM Downloads Monthly NPM Downloads Total

Project is semantically & automatically released on CircleCI with new-release and its New Release GitHub App.

Table of Contents

Install

This project requires Node.js ^6.9.0 || ^8.9.0 || ^10.6.0. Install it using yarn or npm.
We highly recommend to use Yarn when you think to contribute to this project.

$ yarn add collect-mentions

API

collectMentions

Collect all mentions from string. Returns array of objects with properties { handle, mention, index }.

Params

  • str {String}: string to collect mentions from
  • dot {Boolean}: if it is true, it will support mentions including dot
  • returns {Array}: array of objects

Example

import collectMentions from 'collect-mentions';

const mentions = collectMentions('foo @tunnckoCore and yeah @bar, right?')

console.log(mentions)
// => [
//   { handle: '@tunnckoCore', mention: 'tunnckoCore', index: 3 },
//   { handle: '@bar', mention: 'bar', index: 25 },
// ]

// If `dot` boolean is `true`
console.log(collectMentions('some @ok.bar yeah', true))
// => [{ handle: '@ok.bar', mention: 'ok.bar', index: 4 }]

back to top

Related Projects

Some of these projects are used here or were inspiration for this one, others are just related. So, thanks for your existance!

  • asia: Blazingly fast, magical and minimalist testing framework, for Today and Tomorrow | homepage
  • charlike: Small, fast, simple and streaming project scaffolder for myself, but not… more | homepage
  • gitcommit: Lightweight and joyful git commit replacement. Conventional Commits compliant. | homepage
  • new-release: A stable alternative to semantic-release. Only handles NPM publishing and nothing… more | homepage
  • xaxa: Zero-config linting, powered by few amazing unicorns, AirBnB & Prettier. | homepage

back to top

Contributing

Please read the Contributing Guide and Code of Conduct documents for advices.
For bugs reports and feature requests, please create an issue or ping @tunnckoCore at Twitter.

Contributors

Thanks to the hard work of these wonderful people this project is alive and it also follows the all-contributors specification.
Pull requests, stars and all kind of contributions are always welcome. :stars:

Users

You can see who uses collect-mentions in the USERS.md file. Please feel free adding this file if it not exists.
If you or your organization are using this project, consider adding yourself to the list of users.
Thank You! :heart:

License

Copyright (c) 2017-present, Charlike Mike Reagent <[email protected]>.
Released under the Apache-2.0 License.


This file was generated by verb-generate-readme, v0.7.0, on July 25, 2018.