npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

jskernel-sys

v1.0.4

Published

syscall() function for Node.js

Readme

syscall for node.js

Execute POSIX/Linux syscall command from Node.js.

Usage, see syscall reference:

var syscall = require('jskernel-sys').syscall;

// Print `Hello world` in console using kernel's `syscall` command.
var buf = new Buffer('Hello world\n');
syscall(1, 1, buf, buf.length);

// Where, on x86_64 Linux:
// 1 - `sys_write` system call
// 1 - STDOUT file descriptor
// buf - pointer to data in memory
// buf.length - size of the memory block to print

See jskernel-posix for POSIX command implementation.

Reference

syscall and syscall64

type TArg = number|string|Buffer;
function syscall(command: number, ...args: TArg[]): number;
function syscall64(command: number, ...args: TArg[]): [number, number];

syscall accepts up to 6 command arguments args, which are treated as follows depending on their type:

  • number is put directly in the appropriate CPU register as is.
  • string gets converted to C's char * string and that pointer is put in CPU register.
  • Buffer pointer to the raw data in-memory is put in CPU register.

syscall return a number which is the result returned by the kernel, numbers below -1 usually represent an error.

malloc

Returns a Buffer object of size size that is mapped to memory location specified in addr argument.

function malloc(addr: number, size: number): Buffer;

addr and addr64

Return memory address of Buffer's data contents.

function addr(buffer: Buffer): number;
function addr64(buffer: Buffer): [number, number];

addr64 returns a tuple which represents 64-bit number, where first element contains the lower 32 bits and second element has the high 32 bits.

asm [NOT IMPLEMENTED]

Execute assembly code, buffer contains raw op-codes to run.

function asm(buffer: Buffer);

errno

Returns errno variable.

function errno(): number;

Installation

npm i jskernel-sys

Compiles on Ubuntu 14.04 x86_64 running under Docker with Node.js 4.4.3, has not been tested on other machines.

Building addon:

node-gyp configure
node-gyp rebuild