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 🙏

© 2024 – Pkg Stats / Ryan Hefner

r2core

v1.2.3

Published

emscripten build of radare2 with an r2pipe api

Downloads

21

Readme

r2core.js

This is the NodeJS module and Browser ready emscripten builds of radare2.

$ npm install r2core

And now you can run things like that:

$ node -e "console.log(new require('r2core')().cmd('?E Hello World'))"
 .--.     .-------------.
 | _|     |             |
 | O O   <  Hello World |
 |  |  |  |             |
 || | /   `-------------'
 |`-'|
 `---'

API

The API provided is similar to the r2pipe one, so you can reuse the same scripts.

  • .open() - opens a file from an external resource (vfs/net)
  • .cmd() - run a command in r2 and return the string
  • .cmdj() - same as above but parsing the output as JSON
  • .free() - destroy the instance

Example

You can create multiple instances of RCore and you can open external resources too:

const R2Core = require('r2core');
const c = new R2Core();
const c2 = new R2Core();
console.log(c.cmd('wv 123'));
console.log(c2.cmd('p8 4'));

Testing

To get the latest version of r2core.js download it from npm or http://cloud.rada.re/asmjs/r2core.js.

Building

If you are not satisfied by downloading precompiled programs you can also build it yourself by using the radare2-release tool that is available via r2pm:

$ r2pm -r r2rls docker_asmjs

Now you may run make to minify the radare2.js and generating r2core.js. This process is using uglifyjs and closurejs and requires at least 2GB of RAM.

You can now use this file from nodejs or the browser

  • open webtest.html
  • node test.js

Future

  • Integration with brotli (Compression goes from 16MB to 1.8MB)
  • Open Buffers instead of fs/network resources

Author