
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
0-deps async context management for Node.js
Using yarn:
yarn add conode
Using npm:
yarn add conode
Quick start
import { createContext } from 'conode';
interface RequestContext { userId: string }
const reqCtx = createContext<RequestContext>();
async function handleRequest() {
console.log(reqCtx.getContext()?.userId);
}
await reqCtx.contextualize({ userId: 'abc123' }, handleRequest);
// Logs: 'abc123'
Functional approach
import { createContext } from '../index';
const auth = createContext();
const action = () => {
const jwt = auth.getContext();
console.log(jwt);
};
auth.contextualize(jwt, action);
Class approach with decorator
import { contextualize, Contextable } from '../index';
const action = () => {
const service = Service.getContext();
console.log(service.getSomething());
};
class Service extends Contextable() {
@contextualize
async run() {
await action();
}
getSomething() {
return 'something';
}
}
const service = new Service();
service.run();
License Apache-2.0 Copyright (c) 2022-present Ivan Zakharchanka
FAQs
0-Deps, simple and fast context library for NodeJS
The npm package conode receives a total of 3,103 weekly downloads. As such, conode popularity was classified as popular.
We found that conode demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.