JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q38766F
  • License MIT

NodeJS C++ ArrayBuffer handler

Package Exports

  • node-arraybuffer

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-arraybuffer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

NodeJS C++ ArrayBuffer handler

Install

npm install node-arraybuffer --save

Usage

Add node-arraybuffer to your project binding.gyp

"include_dirs" : [
    "<!(node -e \"require('node-arraybuffer')\")"
]

And add #include header in source code

#include <ArrayBuffer.h>

NodeJS version < 12

static ArrayBuffer* New(const char *str = 0)
static ArrayBuffer* New(const char *str, size_t length)
static ArrayBuffer* New(const std::string &data)
static ArrayBuffer* New(const v8::Local<v8::Object> &arrayBuffer)
static ArrayBuffer* New(const v8::Local<v8::Value> &arg)
  
v8::Local<v8::Object> ToArrayBuffer() const
v8::Local<v8::String> ToString() const

const char *ToUtf8() const
void *Data() const
size_t Length() const
size_t ByteLength() const

NodeJS version >= 12

static ArrayBuffer* New(const char *str = 0)
static ArrayBuffer* New(const char *str, size_t length)
static ArrayBuffer* New(const std::string &data)
static ArrayBuffer* New(const v8::Local<v8::ArrayBuffer> &arrayBuffer)
static ArrayBuffer* New(const v8::Local<v8::Value> &arg)

static ArrayBuffer* New(v8::Isolate *isolate, const char *str = 0)
static ArrayBuffer* New(v8::Isolate *isolate, const char *str, size_t length)
static ArrayBuffer* New(v8::Isolate *isolate, const std::string &data)
static ArrayBuffer* New(v8::Isolate *isolate, const v8::Local<v8::ArrayBuffer> &arrayBuffer)
static ArrayBuffer* New(v8::Isolate *isolate, const v8::Local<v8::Value> &arg)

v8::Local<v8::ArrayBuffer> ToArrayBuffer(v8::Isolate *isolate = 0) const
v8::Local<v8::String> ToString(v8::Isolate *isolate = 0) const

const char *ToUtf8() const
void *Data() const
size_t Length() const
size_t ByteLength() const

Example

sample.cc

sample.js