Socket
Socket
Sign inDemoInstall

force-canvas-context

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

force-canvas-context

sanity check to get the context if input happens to be the canvas; errors if it can't return a context


Version published
Maintainers
1
Created
Source

force-canvas-context

sanity check to get the context if input happens to be the canvas; errors if it can't return a context

Build Status npm version

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install force-canvas-context --save

Usage

var forceCanvasContext = require('force-canvas-context');

let canvas = document.createElement('canvas')

let context = forceCanvasContext(canvas)
context = forceCanvasContext(canvas.getContext('2d'))
context = forceCanvasContext('not a context or canvas') // Error

API

forceCanvasContext(ctx:context):context

...

License

MIT

Keywords

FAQs

Package last updated on 14 Aug 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc