
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Supplies a single mixin to enable seamless function and method interop - see hughfdjackson.com/javascript/2012/11/30/tapping-into-the-method-chain/
Tap your functions into method chains.
Functions give us flexibility about granularity and locality, but they can be awkward to compose with an value's methods. tap
makes using functions & methods together idiomatic, natural, and very easy to read. See here for a fuller discussion.
require('tap-chain').mixin(Object.prototype)
var add = function(a, b){ return a + b },
divide = function(a, b){ return a / b }
var people = [
{ name: 'bob', age: 55 },
{ name: 'susan', age: 44 },
{ name: 'charles', age: 20 },
{ name: 'bex', age: 30 }
]
var averageAge = people.map(function(p){ return p.age })
.reduce(add)
.tap(divide, people.length)
.tap(Math.round)
averageAge
//= 37
tap.mixin
(object) -> object
Mixes the .tap
method into any object. If the environment supports es5, then the property will be set to non-enumerable.
.tap
(fn, [secondardy-args]) -> anyValue
The mixed-in .tap
method calls a function, using the context of the method as the first argument:
var inc = function(v){ return v + 1 },
num = 5
num.tap(inc)
//= 6
.tap
also takes optional secondary arguments:
var divide = function(a, b){ return a / b },
num = 10
num.tap(divide, 2)
//= 5
npm install tap-chain
or download. Creates a CommonJS module if available, otherwise exports a global named tap
.
FAQs
Supplies a single mixin to enable seamless function and method interop - see hughfdjackson.com/javascript/2012/11/30/tapping-into-the-method-chain/
The npm package tap-chain receives a total of 0 weekly downloads. As such, tap-chain popularity was classified as not popular.
We found that tap-chain 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
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.