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

prosperent

v1.0.4

Published

A module that implements Prosperent Affiliate Network

Downloads

9

Readme

prosperent.js

Prosperent is an affiliate network to make money from visitors

I created this module because they do not have anything out there to handle node.js as most of their stuff is PHP.

Install

TODO

npm i -S prosperent

Purpose

It is always nice to try and monetize what you have done and people love personalized suggestions. This is a module to assist with connecting up to Prosperent to get their data back and presenting it to your end users.

Dependencies

this is only dependent on axios and because of that promises. I have used a core-js polyfill to make sure that Promises are created in environments that are missing them. Because of the lack of dependencies this should work both in the browser and on Node.js though it is not attached to window so you will have to import it and attach it to a global object if you want it available in all contexts.

API

Simple Usage


import Prosperent from 'prosperent'
const prosper = new Prosperent('<APIKEY>', '<ACCESSKEY>')
prosper.usProducts({ query: 'Shoes' })
.then(({ data }) => console.log(data))

Constructor

new Prosperent(apiKey, accessKey, options)

options

  • clickMaskDomain
    • HIDE THE PROSPERENT URLS FOR ANCHORS mask the Urls that People click to make them appear that they come from your server
  • imageMaskDomain
    • HIDE THE PROSPERENT URLS FOR IMAGES mask the Images so that everything appears to be local
  • location
    • URL OF YOUR SITE this is required in some instances and it is nice to do it at the constructor to prevent the need of doing it on each call

Methods

usProducts(options)

options

  • query: string
  • visitorIp: string,
  • referrer: string,
  • userAgent: string,
  • relevancyThreshold: number, // float
  • filterBrand: string, // pipe separated values
  • filterCatalogId: string, // pipe separated values
  • filterCategory: string, // pipe separated values
  • filterKeyword: string, // pipe separated values
  • filterKeywords: string, // pipe separated values
  • filterMerchant: string, // pipe separated values
  • filterMerchantId: string, // pipe separated values
  • filterPercentOff: number, // float or range
  • filterPremier: boolean,
  • filterPrice: number, // float or range
  • filterPriceSale: number, // float or range
  • filterProductId: string, // float or range
  • sortBy: string, // enum
  • groupBy: string, // enum
  • maxPrice: number, // float
  • minPrice: number, // float
  • maxPriceSale: number, // float
  • minPriceSale: number, // float
  • limit: number, // integer
  • page: number, // integer
  • imageSize: string, // enum
  • sid: string,
  • enableFacets: boolean | string, // boolean or pipe separated facet values
  • enableQuerySuggestion: boolean,
  • enableFullData: boolean,
  • imageMaskDomain: string,
  • clickMaskDomain: string,
  • debugMode: boolean

So the idea behind this is to have a promise interface that will fail fast if you try to do something that is outside of what they suggest. Example being sortBy on US Products is supposed to be one of a list of enumerable values. I want to make it so you do not ever need to question why something is failing so I an rejecting requests that do not fit their expectations before hitting that endpoint.