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

fetchster

v1.0.9

Published

fetch wrapper for easy promise based http requests

Readme

Fetchster

Fetch wrapper for easy promise based http requests

Installation

$ npm install fetchster

import Fetchster via require or es6 module loading

require Fetchster = "fetchster"

import Fetchster from "fetchster"

HTTP methods supported - get, post, put, delete, head

additionally Fetchster comes with a utility function that converts an object into a string of query params.

var queryParams = {page: 3, resultsPerPage: 30, sort: "asscending"}
var sample = Fetchster.seralize(queryParams)
console.log(sample) //=> "page=3&resultsPerPage=30&sort=asscending"

Fetchster.seralize(queryParams)

  • required OBJECT object containing query params in the format {key: value, otherKey: otherValue}

http methods

GET, HEAD

...

 Fetchster.get('http://someapi.org/posts/3').then((response) => {console.log(response)})
 Fetchster = require('fetchster')

 Fetchster.head('http://someapi.org/posts/3').then((response) => {console.log(response)})

Fetchster.get(url, options, errorHandler)

Fetchster.head(url, options, errorHandler)

  • required STRING url - url of api to hit
  • optional OBJECT options - contains configuration defaults to {headers: 'Content-Type': 'application/json'}}, see options section for details.
  • optional FUNCTION errorHandler - function that requires 1 param of err which contains the error object, if not supplied this defaults to console.error(err)

POST, PUT, DELETE

 ...
 
 var body = {sticks: 3, hipster: "dan"}
 
 Fetchster.post('http://someapi.co/hipsters', body).then((response) => console.log(response)}
 
 var body = {name: "dan", hasDog: true}
 
 Fetchster.put('http://someapi.co/hipsters/1', body).then((response) => console.log(response)}
 
 var body = {name: "dan"}
 
  Fetchster.put('http://someapi.co/hipsters', body).then((response) => console.log(response)}

Fetchster.post(url, data, options, errorHandler)

Fetchster.put(url, data, options, errorHandler)

Fetchster.delete(url,data, options, errorHandler)

  • required STRING url - url of api to hit
  • required OBJECT data - object that contains all the information you want to send on the post body
  • optional OBJECT options - contains configuration defaults to {headers: 'Content-Type': 'application/json'}}, see options section for details.
  • optional FUNCTION errorHandler - function that requires 1 param of err which contains the error object, if not supplied this defaults to console.error(err)

Options

{
  headers: //Any headers you want to add to your request, contained within a Headers object or ByteString.
  mode: // The mode you want to use for the request, e.g., cors, no-cors, or same-origin.
  credentails: //The request credentials you want to use for the request: omit, same-origin, or include. To automatically send cookies for the current domain, this option must be provided.
  catche: //The cache mode you want to use for the request: default, no-store, reload, no-cache, force-cache, or only-if-cached.
}

fetch options documentation borrowed from Mozilla Contributors