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

r2pipe-ts

v0.2.0

Published

TypeScript r2pipe API

Downloads

31

Readme

r2pipe API for radare2

r2pipe logo

This is a reimplementation in TypeScript of the original r2pipe and r2pipe-promise modules for NodeJS.

Usage

If you are using r2skel (r2pm -ci r2skel) you can get a hello world to use this module with the following line:

r2pm -r r2skel r2-script-r2pipe-ts hello-ts
make -C hello-ts

Basics

The basic fundamentals of r2pipe is that you the API provides the most basic communication channel with r2, this is a single function called cmd that takes the command to be executed and returns the output of the command as a string.

As long as many commands in r2 return JSON, it is ideal for working with TS/JS, because using cmdj() the API will convert the output into an object.

In order to provide compatibility with all kind of backends, the whole api has been made asynchronous, this allows the developer to change the backend by only changing one line.

Note that stderr events are not handled by this API, process stdin/stdout is also not handled by r2pipe, but there are ways to manage it if needed.

Supported r2pipe methods

  • http (since node 18, plaintext http networking is not allowed unless you use the --insecure-http-parser flag)
  • spawn (launch a new radare2 process and communicate with it sending async commands to collect the response)
  • local (the local pipe is used when launching scripts from r2 -i too.ts or > . too.ts

r2Frida-Compile

radare2 also supports the esm modules generated by frida-compile. But it is worth to mention that r2frida comes with a C reimplementation of frida-compile (python). Which ships a typescript compiler and is able to pack multiple ts/js files into a single file.

Runtime

This module is suposed to run with NodeJS, under some circunstancies, it may also with with r2js, bun or deno.

Author

--pancake <@nopcode.org>