
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
postfunction
Advanced tools
A basic npm module used to *quickly* develop Node.js libraries and functions by exposing them through a webserver, easily allowing you to check it's return value with given arguments. Idea is to work well with pure functions.
A basic npm module used to quickly develop Node.js libraries and functions by exposing them through a webserver, easily allowing you to check it's return value with given arguments. Idea is to work well with pure functions.
Require the module in the file you have your functions in and just startWith the functions passed in:
const postfunction = require('./index');
function isEven(number) {
return number % 2 === 0 ? `${number} is even!` : `${number} is odd.`
}
function someAsync(firstName, lastName) {
return Promise.resolve(`Hello ${firstName} ${lastName}!`);
}
function greeting(firstName, lastName) {
return someAsync(firstName, lastName);
}
postfunction.startWith(isEven, greeting);
...
The server starts on a random port and the following is logged in the app's console:
postFunction Server listening on port: 53883
Now just POST your arguments to http://localhost:port/functionName and have a look at your response!
Request:
{ "firstName": "John", "lastName": "Doe" }
Response:
{ "type": "promise<string>", "resolved": "Hello John Doe!", "rejected": null }
Magic!
As of now, the only configuration available is the ability to define a port to start the server on. This is probably going to be useful.
postfunction.setPort(3000);
So far, only a regular JS object, type or Promise is supported. I would like the option to have the function run in a Node.js VM instance for pure functions to avoid side effects. A basic test has been written but please bare in mind this is pretty much the 'fist stab' at this so I'm sure it can be improved in may ways.
FAQs
A basic npm module used to *quickly* develop Node.js libraries and functions by exposing them through a webserver, easily allowing you to check it's return value with given arguments. Idea is to work well with pure functions.
We found that postfunction 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

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.