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

cnfair-cli

v0.0.8

Published

CLI used to interact with CNFair

Downloads

2

Readme

cnfair

Installation

Using NPM (recommended)

1. Installing Node.JS

Install the latest version of Node.JS

2. Installing the CLI

Run the following command:

npm i -g cnfair-cli

Manual installation

1. Installing Node.JS

Install the latest version of Node.JS

2. Installing Bun

Install the latest version of Bun

3. Installing dependencies

Run the following command:

bun install --production --frozen-lockfile

4. Build the CLI

Run the following command:

bun run build

5. Link the CLI

Run the following command:

bun link

Updating

To update the CLI you can simply run the following command:

npm i -g cnfair-cli

Usage

To use the CLI run the following command:

cnfair --help

Commands

token [token]

Allows to set the pandabuy token used to redeem the products

You can find out your current token by running this in a browser tab currently logged into pandabuy:

token = localStorage.getItem("PANDABUY_TOKEN");
console.log(token || "ERROR: Pandabuy token not found")

redeem [options] <productIds...>

Recovers the redeem code for every specified productId on CNFair and then redeem them on Pandabuy.

Product ids often look like this: PI0000000000 and can be found in the URL of a CNFair product, example: https://cnfair.com/detail/PI0000000000

Options

| flag | description | Default | |--------------------------|-------------------------------------------------------------|---------| | -r, --restock | Enable restock mode | false | | -d, --delay | Delay between each attempts in seconds | 5 | | --restock-delay | Delay between each attempts in seconds when in restock mode | 10 | | -w, --way | Payment method (choices: "points", "balance") | points |

Examples

Redeem a single product: cnfair redeem PI00000001

Redeem two products: cnfair redeem PI00000001 PI00000002

Redeem two products and pay with balance: cnfair redeem -w balance PI00000001 PI00000002

Redeem a product with a retry delay of 1s: cnfair redeem -d 1 PI00000001

Monitor a product for restock: cnfair redeem -r PI00000001

Monitor a product for restock every 20s: cnfair redeem -r --restock-delay 20 PI00000001

Redeem 3 products with a delay of 1s, enable restock monitoring with a delay of 20s and pay with balance: cnfair redeem -d 1 -r --restock-delay 20 -w balance PI00000001 PI00000002 PI00000003