
Research
Node.js Fixes AsyncLocalStorage Crash Bug That Could Take Down Production Servers
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.
get-context
Advanced tools
get-contextChainable canvas context api wrapper.
With Node.js:
$ npm install get-context
With Bower:
$ bower install get-context
getContext(element, type)Creates an instance of a chainable canvas context api wrapper. The type argument may be '2d' or 'webgl'. Defaults to '2d'.
var canvas = document.createElement('canvas');
var context = require('get-context')(canvas);
context
.set({
strokeStyle: '#0000ff',
lineCap: 'round'
})
.beginPath()
.arc(75, 75, 50, 0, Math.PI * 2, true) // Outer circle
.moveTo(110, 75)
.arc(75, 75, 35, 0, Math.PI, false) // Mouth (clockwise)
.moveTo(65,65)
.arc(60, 65, 5, 0, Math.PI * 2, true) // Left eye
.moveTo(95,65)
.arc(90, 65, 5, 0, Math.PI * 2, true) // Right eye
.stroke();
.get(key)Gets a single context property.
context.get('fillStyle');
// returns #000000
.get(array)Gets multiple context properties.
context.get(['fillStyle', 'strokeStyle']);
// returns { fillStyle: '#000000', strokeStyle: '#000000' }
.set(key, value)Sets a single context property.
context.set('fillStyle', '#FF0000');
// returns context
.set(object)Sets multiple context properties.
context.set({
fillStyle: '#FF0000',
strokeStyle: '#00FF00'
});
// returns context
.resize(width, height)Resizes the canvas element and rendering context respecting the device pixel ratio.
context.resize(1024, 768);
// returns context
.getPixelRatio()Returns the current device pixel ratio, if available. Useful for handling responsive canvas elements and adjusting the current scale. Defaults to 1.
$ npm test
© 2015 Shannon Moeller me@shannonmoeller.com
Licensed under MIT
FAQs
Chainable canvas wrapper.
The npm package get-context receives a total of 4 weekly downloads. As such, get-context popularity was classified as not popular.
We found that get-context 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.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.