Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@6river/context
Advanced tools
This is a promise-based port of Go conext library.
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries.
Incoming requests to a service should create a Context, and outgoing calls to service should accept a Context. The chain of function calls between them must propagate the Context, optionally replacing it with a derived Context created using withCancel, withDeadline, withTimeout, or withValue. When a Context is canceled, all Contexts derived from it are also canceled.
The withCancel, withDeadline, and withTimeout functions take a Context (the parent) and return a derived Context (the child) and a CancelFunc. Calling the CancelFunc cancels the child and its children, removes the parent's reference to the child, and stops any associated timers. Failing to call the CancelFunc leaks the child and its children until the parent is canceled or the timer fires.
Programs that use Contexts should follow these rules to keep interfaces consistent across packages and enable static analysis tools to check context propagation:
Do not store Contexts inside a struct type; instead, pass a Context explicitly to each function that needs it. The Context should be the first parameter, typically named ctx:
function doSomething(ctx: context.Context, arg: Arg) { // ... use ctx ... }
Use context Values only for request-scoped data that transits processes and APIs, not for passing optional parameters to functions.
FAQs
This is a promise-based port of Go conext library.
The npm package @6river/context receives a total of 2 weekly downloads. As such, @6river/context popularity was classified as not popular.
We found that @6river/context demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.