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 🙏

© 2026 – Pkg Stats / Ryan Hefner

grepper

v1.0.6

Published

A Light-weight Wrapper for CodeGrepper APIs

Readme

GREPPER Overall Downloads

yarn add grepper
npm install grepper
const GREPPER = require("grepper");

Quick Guide

Global

checkToken()

To check if a token is valid use this function.

async function __main__() {
  GREPPER.checkToken({
    token: process.ENV.TOKEN, // access_token of the Targeted user
    userId: process.ENV.TOKEN, // userId of the Targeted user
  })
    .then((res) => {
      // Your Code Goes Here
    })
    .catch((err) => {
      console.log(err);
    });
}
__main__();

nominateSuper()

Nominate a user as a super nominee.

async function __main__() {
  const Data = await GREPPER.nominateSuper({
    nomineeId: 98467, // The user you want to nominate
    awardName: "best_coder", // The award name
    token: process.ENV.TOKEN, // access_token of the Targeted user
    userId: process.ENV.TOKEN, // userId of the Targeted user
  });
  console.log(Data);
}
__main__();
Award Names:
most_helpful, hard_worker, class_clown, best_smile, most_likely_billion, best_hair, most_intelligent, best_coder, most_attractive, most_creative

Login()

Login with username & password.

async function __main__() {
  const Account = await GREPPER.Login({
    email: process.env.EMAIL, // Your Account Email
    password: process.env.PASSWORD, // Your Account Password
  });
  console.log(Account);
}
__main__();
{
  "errors": [],
  "success": true,
  "access_token": "",
  "user_id": 0,
  "email": "",
  "hide_grepper_button": 0,
  "grepper_user_langs": [
    {
      "lkey": "abap",
      "name": "Abap",
      "enabled": 0
    }
  ],
  "blacklists": []
}

Signup()

Signup with username & password.

async function __main__() {
  const Account = await GREPPER.Signup({
    email: process.env.EMAIL, // Account Email
    password: process.env.PASSWORD, // Account Password
  });
  console.log(Account);
}
__main__();
{
  "Success": true,
  "Message": "Successfuly Registered New Account.",
  "Data": {
    "errors": [],
    "success": true,
    "access_token": "",
    "user_id": 1,
    "email": "string",
    "hide_grepper_button": null,
    "grepper_user_langs": [
      {
      "lkey": "abap",
      "name": "Abap",
      "enabled": 0
      }
    ],
    "blacklists": [],
  },
};

getCommunity()

Function to get codegrepper top users(community) from the community page. The first parameter is the [Token][], The second parameter is limit of users to get(default: 100).

async function __main__() {
  Data = await GREPPER.getCommunity(
    {
      token: process.ENV.TOKEN, // access_token of the Targeted user
      userId: process.ENV.TOKEN, // userId of the Targeted user
    },
    200
  );
  console.log(Data);
}
__main__();

sendPasswordResetEmail()

Sends a reset password email to the provided email address.

async function __main__() {
  Data = await GREPPER.sendPasswordResetEmail("[email protected]");
  console.log(Data);
}
__main__();

Users

userInfo()

Fetches code Grepper user's profile information. The first parameter is the user_id(int).

async function __main__() {
  Data = await GREPPER.userInfo(98467);
  console.log(Data);
}
__main__();

updateProfile()

Update user's profile.

async function __main__() {
  const Data = await GREPPER.updateProfile({
    token: process.ENV.TOKEN, // access_token of the Targeted user
    userId: process.ENV.TOKEN, // userId of the Targeted user
    funName: `GrepperBot`,
    realName: `GrepperBot-betav1`,
    websiteURL: User.website_url,
    location: User.location,
    donateURL: User.donate_link,
    twitterName: User.twitter_name,
    howToHelp: User.how_to_help,
  });
  console.log(Data);
}
__main__();

updateProfileImage()

Update user's profile image(avatar).

async function __main__() {
  const Data = await GREPPER.updateProfileImage({
    token: process.ENV.TOKEN, // access_token of the Targeted user
    userId: process.ENV.TOKEN, // userId of the Targeted user
    imageURL: `https://.../example.png`, // URL of the image you want as your profile picture
  });
  console.log(Data);
}
__main__();
{
  "Success": true,
  "Message": "Profile Updated",
  "Data": {
    "URL": "https://www.codegrepper.com/profile/username"
  }
}

userByToken()

Fetches code Grepper user's information by their ACCESS_TOKEN.

async function __main__() {
  Data = await GREPPER.userByToken({
    token: process.ENV.TOKEN, // access_token of the Targeted user
    userId: process.ENV.TOKEN, // userId of the Targeted user
  });
  console.log(`Successfuly Logged in as ${Data.Name}`);
}
__main__();

userBeltStats()

Fetches The user's code grepper belt stats. The first parameter is the user_id(int).

async function __main__() {
  Data = await GREPPER.userBeltStats(98467);
  console.log(Data);
}
__main__();

userStats()

Fetches The user's code grepper helped and problems solved stats. The first parameter is the user_id(int).

async function __main__() {
  Data = await GREPPER.userStats(98467);
  console.log(Data);
}
__main__();

userTopAnswers()

Fetches The user's top code grepper answers. The first parameter is the user_id(int).

async function __main__() {
  Data = await GREPPER.userTopAnswers(98467);
  console.log(Data);
}
__main__();

searchUsers()

Searches for code grepper users The first parameter is the user_name(str).

async function __main__() {
  Data = await GREPPER.searchUsers("Jareer");
  console.log(Data);
}
__main__();

getWhoToFollow()

This functions gets all the recommended users to follow that you can find on the feed page.

async function __main__() {
  Data = await GREPPER.getWhoToFollow({
    token: process.ENV.TOKEN, // access_token of the Targeted user
    userId: process.ENV.TOKEN, // userId of the Targeted user
  });
  console.log(Data);
}
__main__();

Answers

getAnswers()

Fetches coding answers from code grepper, enter the query in the first parameter.

async function __main__() {
  Data = await GREPPER.getAnswers("js loop");
  console.log(Data);
}
__main__();

saveAnswer()

Save an answer to grepper.

async function __main__() {
  const Res = await GREPPER.saveAnswer({
    token: process.ENV.TOKEN, // access_token of the Targeted user
    userId: process.ENV.TOKEN, // userId of the Targeted user
    sourceURL: ``,
    teamIds: [],
    langauge: `js`
    isPrivate: false, // default false
    query: `Javascript Loop`, // required
    answer: `for(i...`, // required
  });
}
__main__();

getComments()

Fetches comments from code grepper coding answers, first parameter is answerId(int).

async function __main__() {
  Data = await GREPPER.getComments(23);
  console.log(Data);
}
__main__();

getSimiliarQueries()

Fetches similiar queries like the one provided, eg, if you enter js loop it will return javascript loop, loop in javascript, loop javascript

async function __main__() {
  Data = await GREPPER.getSimiliarQueries("js loop");
  console.log(Data);
}
__main__();

Settings

enableCommentNotif()

Enables your comment notifications from the settings.

async function __main__() {
  Data = await GREPPER.enableCommentNotif({
    token: process.ENV.TOKEN, // access_token of the Targeted user
    userId: process.ENV.TOKEN, // userId of the Targeted user
  });
  console.log(Data);
}
__main__();

disableCommentNotif()

Disables your comment notifications from the settings.

async function __main__() {
  Data = await GREPPER.disableCommentNotif({
    token: process.ENV.TOKEN, // access_token of the Targeted user
    userId: process.ENV.TOKEN, // userId of the Targeted user
  });
  console.log(Data);
}
__main__();

getPrivacySettings()

Gets you privacy settings.

async function __main__() {
  Data = await GREPPER.getPrivacySettings({
    token: process.ENV.TOKEN, // access_token of the Targeted user
    userId: process.ENV.TOKEN, // userId of the Targeted user
  });
  console.log(Data); // Data.Data is the actual object with data
}
__main__();

Teams

inviteToTeam()

Invite users to a team.

async function __main__() {
  Data = await GREPPER.inviteToTeam({
    teamId: 525,
    usersArray: [4, 98467], // Ids of the users you want
  });
  console.log(Data); // Data.Data is the actual object with data
}
__main__();

Example Usage

// Fetching Privacy Settings By Username & Password
async function __main__() {
  const Account = await GREPPER.Login({
    email: "[email protected]",
    password: "password",
  });
  const Data = await GREPPER.Login({
    token: Account.Data.access_token,
    userId: Account.Data.user_id,
  });
  console.log(Data);
}
__main__();