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

top2csv

v1.0.2

Published

Convert Memory Logs to Csv format

Downloads

1

Readme

How to generate Csv

  1. source ~/.bash_profile (Optional, in case you don't have adb in your $PATH)
  2. adb shell (To Enter Shell)
  3. Run top command in shell // For ShareChat: top -o PID,TIME,RES,USER -p $(pidof in.mohalla.sharechat) -d 1 -q > /sdcard/top.txt // For Instagram: top -o PID,TIME,RES,USER -p $(pidof com.instagram.android) -d 1 -q > /sdcard/top.txt
  4. Ctrl + C (to stop recording)
  5. exit (to Exit from Shell)
  6. adb pull /sdcard/top.txt .
  7. generateCsv ShareChat

Output csv file is saved in ./outputs/ folder in project root. Import this csv in Google Sheet/Spreadsheet program to visiualize the data.

Install Local npm package

npm link

Create shortcuts

  1. Edit and add following methods in your ~/.bash_profile
recordtop() {
  if [ $# -eq 0 ]
  then
    pckg="in.mohalla.sharechat"
  else
    pckg="$1"
  fi

   adb shell monkey -p $pckg -c android.intent.category.LAUNCHER 1
   echo "\n\nNext Steps:"
   echo "1. First Shell command is copied, Paste!"

   part1="top -o PID,TIME,RES,USER -p $"
   part2="(pidof "
   part3="$pckg"
   part4=") -d 1 -q > /sdcard/top.txt"
   
   echo $part1$part2$part3$part4| pbcopy
   echo "2. Ctrl + C to stop recording"
   echo "3. exit (to Exit Shell)"
   echo "4. Run tocsv [Label], eg. tocsv ShareChat\n\n"
   adb shell
}

tocsv() {
  if [ $# -eq 0 ]
  then
    label="ShareChat"
  else
    label="$1"
  fi
  adb pull /sdcard/top.txt .
  mkdir -p outputs
  generateCsv $label
  rm top.txt
  open ./outputs/
}
  1. Save
  2. Run source ~/.bash_profile from a new terminal
  3. Run recordtop com.instagram.android to open Instagram App and initiate shell session.
  4. Follow the instructions on the Terminal
  5. After recording, run tocsv Instagram, this will generate csv.