
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
Peek into a functional pipeline to see intermediate results without interfering with the flow.
Peek into a functional pipeline to see intermediate results without interfering with the flow.
yarn add pipe-peek
or if you prefer npm:
npm install --save pipe-peek
const peek = require(`pipe-peek`);
// or if you use ES6 module syntax:
import peek from 'pipe-peek';
const { add, multiply, pipe, subtract } = require(`lodash/fp`);
const fahrenheitToCelsius = pipe(
subtract(32),
multiply(5 / 9)
);
const celsiusToKelvin = add(273.15);
let fahrenheitToKelvin = pipe(
fahrenheitToCelsius,
peek, // Should console.log the temperature in Celsius
celsiusToKelvin
);
fahrenheitToKelvin(32); // outputs 0 to the log
// => 273.15
You can also import the function peekWith by name. It differs from peek in
that it expects a function as an argument and calls that function instead of
console.log on the intermediate result.
Let's redefine fahrenheitToKelvin to demonstrate:
const { peekWith } = require(`pipe-peek`);
// or
import { peekWith } from 'pipe-peek';
fahrenheitToKelvin = pipe(
fahrenheitToCelsius,
peekWith(console.info), // Outputs temp in Celsius using console.info instead of console.log
celsiusToKelvin
);
fahrenheitToKelvin = pipe(
fahrenheitToCelsius,
peekWith(celsius =>
console.log(`The temperature in Celsius is ${celsius}`),
),
celsiusToKelvin
);
FAQs
Peek into a functional pipeline to see intermediate results without interfering with the flow.
We found that pipe-peek 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.