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

native-calls

v0.2.0

Published

A JavaScript - C++ RPC library generator

Readme

Native Calls

Native Calls allows developers to write IDL files that get compiled into C++ and JavaScript stubs that implement RPC calls over postMessage. The result is a nice, clean way of using Native Code straight from JavaScript!

Part of my final year project at Imperial College London.

This is still work in progress, but feedback is much appreciated!

Getting started

Please read the getting started guide to see how Native Calls works and how to use it.

Build

To build the project, you'll need the following requirements:

  1. The Native Client SDK.
  2. The NACL_SDK_ROOT variable set.
  3. node.js

To build, simply run make in this folder. This will get JavaScript dependencies, build the C++ RPC library and build each individual demo.

Note: I have only tested this on Mac OSX and linux. Compiling on Windows will probably break.

Run

To see it in action, make sure you have built the project (see above). Then, type make serve. This will start a server in the project directory.

Visit the index page, by typing http://localhost:3000/ into your browser.

Install

To install the C++ library to your SDK, run make install. This will build the library for all toolchains and configurations. This will also install the generator, pprpcgen globally.

If you want to only install pprpcgen without cloning this repository, you can type npm install -g native-calls.

Development

Test

To run all tests, type make test. This will test JavaScript front end, back end (generators), and C++ tests. You can also test each component individually:

  • make test runs all tests
  • make nodetest runs generator tests
  • make cpptest runs C++ rpc framework tests
  • make eetest runs end-to-end tests
  • make jstest runs JavaScript rpc framework tests

The tests are run using karma.

TODO

If you're interested in contributing, here are some things that still need to be done...

  • Generating JS skeletons for the Emscripten code (possibly in combination pepper.js) and provide automatic fallback for browsers which don't support Native Client
  • Performance optimization, in particular efficient use of binary arrays
  • Generating C++ stubs and JS skeletons to allow calls from native into JS code
  • Support for transferring binary

Docs

You can read some design docs in the docs folder.

The full project report (in progress) is written in TeX and is found in the report repo.

Eclipse

How to set up the Native Calls project in Eclipse.

A project has already been created and is in the repository. All you need to do is to configure it with your NACL_SDK_ROOT.

  1. Download eclipse CDT
  2. Clone the Native Calls project.
  3. Copy the .cproject.sample file and save it as .cproject.
  4. Open eclipse
  5. Import the project. File -> Import... -> Existing Project into Workspace
  6. Right click on the project and click properties.
  7. Under C/C++ Build -> Enivronment, set the NACL_SDK_ROOT variable to be the NaCl SDK location. Save for all configurations.
  8. Under C/C++ Build -> Build Variables, set the NACL_SDK_ROOT variable to be a directory pointing to your NaCl SDK location. Save for all configurations.
  9. Right click on the project and choose Index -> Rebuild to rebuild the index.
  10. Done! Clicking the build button runs make.

You can also set up eclipse to debug the C/C++ application. This is shown in the chromium how-to.