New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

type-pointer

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

type-pointer

nodejs pointer

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

type-pointer

nodejs pointer

install

npm install type-pointer

prepare

npm install node-gyp -g

You can see:https://github.com/nodejs/node-gyp#installation

example

const TypePointer = require('type-pointer');
const assert = require('assert');

let typePointer = new TypePointer();
var obj1 = {a:1,b:2,c:()=>{return a+b;}};
//----------------mallocValueAddr-----------------
var addr = typePointer.mallocValueAddr(obj1);
//console.log(addr);//0x102709430
assert(parseInt(addr,16)>0,"mallocValueAddr failed");
//----------------readValueByAddr-----------------
var obj2 = typePointer.readValueByAddr(addr);
assert.deepEqual(obj2, obj1, "readValueByAddr failed");
var obj3 = {d:4};
//----------------writeValueByAddr-----------------
typePointer.writeValueByAddr(addr,obj3);
var obj4 = typePointer.readValueByAddr(addr);
assert.deepEqual(obj4, obj3, "writeValueByAddr failed");
//----------------freeValueByAddr-----------------
typePointer.freeValueByAddr(addr);
var obj5 = typePointer.readValueByAddr(addr);
assert.deepEqual(obj5, undefined, "freeValueByAddr failed");

Keywords

point

FAQs

Package last updated on 09 Apr 2018

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