
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.
css-to-js-sourcemap-worker
Advanced tools
The purpose of this package is to generate CSS with arbitrary classes that have sourcemaps to arbitrary lines in JS (at runtime). This may be useful for CSS-in-JS abstractions.
The purpose of this package is to generate CSS with arbitrary classes that have sourcemaps to arbitrary lines in JS (at runtime). This may be useful for CSS-in-JS abstractions.
Because parsing and generating sourcemaps is expensive, this package provides a web worker implementation so it can be performed off the main thread.
type MessageToWorker =
| {id: "init_wasm", url: string}
| {
id: "add_mapped_class",
className: string,
stackInfo: ErrorLikeObject,
stackIndex: number
}
| {id: "set_render_interval", interval: number}
| {id: "clear_render_interval"}
| {id: "render"}
| {id: "invalidate"};
type MessageFromWorker =
{id: "render_css", css: string};
type ErrorLikeObject = {
stack?: string,
stacktrace?: string,
message?: string
};
const worker = new Worker("https://unpkg.com/css-to-js-sourcemap-worker/worker.js");
worker.onmessage = msg => {
const {id, css} = msg.data;
if (id === "render_css" && css) {
const style = document.createElement("style");
style.appendChild(document.createTextNode(css));
document.head.appendChild(style);
}
};
const {stack, stacktrace, message} = new Error("create stack trace");
worker.postMessage({
id: "init_wasm",
url: "https://unpkg.com/css-to-js-sourcemap-worker/mappings.wasm",
});
worker.postMessage({
id: "add_mapped_class",
className: "__debug-1",
stackInfo: {stack, stacktrace, message},
stackIndex: 0,
});
worker.postMessage({
id: "set_render_interval",
interval: 120,
});
FAQs
The purpose of this package is to generate CSS with arbitrary classes that have sourcemaps to arbitrary lines in JS (at runtime). This may be useful for CSS-in-JS abstractions.
The npm package css-to-js-sourcemap-worker receives a total of 35 weekly downloads. As such, css-to-js-sourcemap-worker popularity was classified as not popular.
We found that css-to-js-sourcemap-worker 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.