Socket
Socket
Sign inDemoInstall

force-canvas-context

Package Overview
Dependencies
1
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

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
Weekly downloads
13
decreased by-18.75%
Maintainers
1
Created
Weekly downloads
 

Readme

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

Last updated on 14 Aug 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc