
Security News
/Research
npm Phishing Email Targets Developers with Typosquatted Domain
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
hydrate-stream
Advanced tools
An experimental batteries excluded stream transformer with a simple API for declaritively hydrating elements (like adding onclick handlers).
The motivation behind this is to do server side rendering and selectively hydrating the interactive elements on a page. This is an experiment at building a minimal framework around streaming rendering.
npm install hydrate-stream
import { hydrateStream } from 'hydrate-stream';
const hydrators = [{
id: 'root',
key: 'onload',
value: `
function loadJS() {
console.log('script run on load');
}
loadJS();
`
}, {
id: 'cta',
key: 'onclick',
value: `
function minimalJS() {
console.log('script run on click');
}
minimalJS();
`
}];
renderToStaticNodeStream(<Component />).pipe(hydrateStream(hydrators))
Two basic use cases are onclick
and onload
. For onload
a <script>
tag is injected after the mapped element.
See example directory
FAQs
attach javascript handlers to html streams
We found that hydrate-stream 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
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.