
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
array-filter-inplace
Advanced tools
Remove non-matching elements from a dense array.
This module exports one function:
Test array
's items, starting at offset
(default = 0) by calling the
test
function with arguments (value, index, array)
.
If the test result isn't truthy, the item is removed¹ from the array.
Returns array
.
¹ "Remove" means it's either replaced with the next value that passes
the test, or cut off by setting array.length
.
from test.usage.js:
var filter = require('array-filter-inplace'), a, b, offset,
files = [ '.', '..', '.git', 'bin', 'README.md', 'package.json' ];
function notDotFile(s) { return (s.slice(0, 1) !== '.'); }
a = files.slice();
b = filter(a, notDotFile);
equal(a, [ 'bin', 'README.md', 'package.json' ]);
equal(a, b);
a = files.slice();
offset = 2; // skip the first two items
b = filter(a, notDotFile, offset);
equal(a, [ '.', '..', 'bin', 'README.md', 'package.json' ]);
equal(a, b);
function isLower(s) { return (/[a-z]/.test(s) && (!/[A-Z]/.test(s))); }
a = files.slice();
b = filter(a, isLower);
equal(a, [ '.git', 'bin', 'package.json' ]);
equal(a, b);
ISC
FAQs
Remove non-matching elements from a dense array.
The npm package array-filter-inplace receives a total of 6 weekly downloads. As such, array-filter-inplace popularity was classified as not popular.
We found that array-filter-inplace 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.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.