
Research
/Security News
Malicious Chrome Extension Performs Hidden Affiliate Hijacking
A Chrome extension claiming to hide Amazon ads was found secretly hijacking affiliate links, replacing creators’ tags with its own without user consent.
parse-mentions
Advanced tools
Parse and optionally replace @ mentions from a string of text.
Install with npm:
$ npm install --save parse-mentions
var parse = require('parse-mentions');
Parse a string to retrieve or replace @ mention strings.
Params
str {String}: Input string to parse looking for @ mentions.options {Object}: Optional options object to control the output of the @ mentionsoptions.stringify {Boolean}: Should the @ mentions be stringified in the output array. When false an object with additional information about the mention is returned. Defaults to true.fn {Function}: Optional replace function. When passed in, the @ mentions are replaced in the string instead of returned as an array. The new string is returned.returns {String|Array}: Array of mentions when a replace function is not passed in.Example
// get an array of @ mention strings
var mentions = parse('- @doowb\n- @jonschlinkert');
console.log(mentions);
//=> ['doowb', 'jonschlinkert']
// replace @ mention strings with a url
var str = parse('- @doowb\n- @jonschlinkert', function(name) {
return `[@${name}](https://github.com/${name})`;
});
console.log(str);
//=> - [@doowb](https://github.com/doowb)
//=> - [@jonschlinkert](https://github.com/jonschlinkert)
// get an array of @ mention objects
var mentions = parse('- @doowb\n- @jonschlinkert', {stringify: false});
console.log(mentions);
//=> [
//=> {name: 'doowb', mention: '@doowb', index: 2},
//=> {name: 'jonschlinkert', mention: '@jonschlinkert', index: 11}
//=> ]
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for avice on opening issues, pull requests, and coding standards.
(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)
To generate the readme and API documentation with verb:
$ npm install -g verb verb-generate-readme && verb
Install dev dependencies:
$ npm install -d && npm test
Brian Woodward
Copyright © 2016, Brian Woodward. Released under the MIT license.
This file was generated by verb-generate-readme, v0.1.30, on September 24, 2016.
FAQs
Parse and optionally replace @ mentions from a string of text.
The npm package parse-mentions receives a total of 53 weekly downloads. As such, parse-mentions popularity was classified as not popular.
We found that parse-mentions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A Chrome extension claiming to hide Amazon ads was found secretly hijacking affiliate links, replacing creators’ tags with its own without user consent.

Security News
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.