
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
http-post-message
Advanced tools
A generic messaging component to send HTTP style message payloads over the window.postMessage API. Requires an implementation of window postMessage proxy such as 'window-post-message-proxy'.
A generic messaging component to send HTTP style message payloads over the window.postMessage API. Requires an implementation of window postMessage proxy such as 'window-post-message-proxy'.
npm install -g http-post-message
The HttpPostMessage takes in an object that implements the IPostMessage interface which
is just one method postMessage
which returns a Promise.
In the case below we created a mock postMessage proxy, but in normal usage you would likely use the accompanying library window-post-message-proxy.
import * as hpm from 'http-post-message';
const stubWindowPostMessageProxy: hpm.IPostMessage = {
postMessage(message: any) {
console.log(message);
return Promise.resolve(message):
}
}
const httpPostMessage = new hpm.HttpPostMessage(stubWindowPostMessageProxy);
httpPostMessage.get('target/path')
.then(response => {
...
});
The object supports all the standard http methods, get
, post
, put
, patch
, and delete
.
You can also send an IRequest
object directly to the lower-level send
method.
FAQs
A generic messaging component to send HTTP style message payloads over the window.postMessage API. Requires an implementation of window postMessage proxy such as 'window-post-message-proxy'.
The npm package http-post-message receives a total of 119,435 weekly downloads. As such, http-post-message popularity was classified as popular.
We found that http-post-message 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.