
Security News
/Research
npm Phishing Email Targets Developers with Typosquatted Domain
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Find the substring / element between the $start and $end argument.
Developers often need to find a string between two elements. This package will simplify that task by abstract away the regex part.
$ npm i --save among
const among = require('among');
const str = 'The [quick] [brown] {{fox}} $jumps$ over the [lazy] {{dog}}';
let find = among('{{', '}}');
console.log(find(str));
find = among('[', ']', true);
console.log(find(str));
console.log(among('$', '$')(str));
Result:
[ 'fox', 'dog' ]
[ '[quick]', '[brown]', '[lazy]' ]
[ 'jumps' ]
const find = among(string $start, string $end [, boolean $preserved]);
find(string $str)
$start is the first string to match
$end is the last string to match
$preserved is if the $start and $end strings should be preserved(optional)
$str the input string to search for elements
$ npm test
Contributions are appreciated.
MIT-licensed. See LICENSE.
FAQs
Find the substring / element among $start and $end argument.
The npm package among receives a total of 262 weekly downloads. As such, among popularity was classified as not popular.
We found that among demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.