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 🙏

© 2025 – Pkg Stats / Ryan Hefner

instafetch.js

v1.5.0

Published

A 6KB JavaScript plugin for the Instagram API (without jQuery).

Readme

Instafetch.js

Build Status Dependency Status

Instafetch.js is a 6KB JavaScript plugin for the Instagram API using fetch instead of jQuery.

Installation

Instafetch.js is available on CDNJS, NPM, Bower, and GitHub.

CDNJS

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/instafetch.js/1.5.0/instafetch.min.js"></script>

NPM

npm install --save instafetch.js
require('instafetch.js');

Bower

bower install instafetch.js
<script type="text/javascript" src="path/to/bower_components/instafetch.js/dist/instafetch.min.js"></script>

GitHub

Download the script or the minified version in the dist folder.

<script type="text/javascript" src="path/to/instafetch.min.js"></script>

Usage

The Instagram API uses the OAuth 2.0 protocol, so you're going to need an access token. The easiest way to get your access token is login to Instagram on your browser and generate one on Pixel Union.

<script type="text/javascript">
  instafetch.init({
    accessToken: 'ACCESS TOKEN',
    target: 'instafetch',
    numOfPics: 20,
    caption: false
  });
</script>

Instafetch.js will look for an element with the ID of instafetch by default. The target element can be changed when initializing the plugin.

The plugin also allows you to set the number of items to return from your feed and if you want to include the captions.

Promise Polyfill

Instafetch.js was only 3KB initially, but those 3KB didn't support any version of Internet Explorer. IE will return "Promise is undefined" and the Instagram feed will be empty. Version 1.2 included the ES6-Promise polyfill, which added an extra 7KB just for IE. Version 1.3 removed the ES6-Promise polyfill for another Promise polyfill that only added 3KB.

Changelog

1.5

  • Updated Promise polyfill
  • Fixed bug for returned images without a caption

1.4

  • Updated Fetch-JSONP
  • Switched from ES5 to ES6

1.3

1.2.2

  • Fixed installation instructions for NPM

1.2.1

  • Published different paths on NPM and Bower

1.2

1.1

  • Changed Instagram API endpoint
  • Removed user ID

1.0

  • Initial release

Issues

Please submit any issues here.

License

Instafetch.js is licensed under the MIT License.