Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scratch

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scratch

Scratch memory

  • 0.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

scratch

Reuse scratch memory for intermediate calculations. This is useful for avoiding costly reallocations and for keeping temporary array data in hot cache between procedure calls.

Install

npm install scratch

require("scratch")(n[, dtype])

Returns a temporary array buffer for intermediate calculations.

  • n is the length of the array
  • dtype is an optional string which specifies the type of the typed array to return. Possible options are:
    • "uint8"
    • "uint16"
    • "uint32"
    • "int8"
    • "int16"
    • "int32"
    • "float32"
    • "float64"
    • undefined - Returns an ArrayBuffer

Returns A typed array of length n

Warning

This module is non-reentrant. Once you have allocated scratch memory, you should not call any submodules, or else they may overwrite the contents of the data in scratch. You should only use this module if you know what you are doing.

Credits

(c) 2013 Mikola Lysenko. MIT License

Keywords

FAQs

Package last updated on 11 May 2013

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