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

quick-gist

v1.5.1

Published

Quickly create anonymous GitHub gists.

Downloads

77

Readme

quick-gist NPM version Build Status Dependency Status

Quickly create anonymous GitHub gists.

Installation

$ npm install --save quick-gist

Usage

GitHub deprecated anonymous gists so you'll need to authenticate. :sob:

Using GitHub Enterprise? Set your gist endpoint with QUICK_GIST_ENDPOINT (e.g. https://github.yourcompany.com/api/v3/gists).

GitHub's public API at https://api.github.com/gists is used by default. Uses language-classifier to guess file languages.

var quickGist = require('quick-gist');

quickGist({
  content: 'gists are fun',
  description: 'This gist is the best', // Optional
  public: false, // Whether the gist should be public or unlisted. Defaults to false (unlisted).
  enterpriseOnly: false, // Prohibit posting to GitHub.com. Defaults to false. Useful if you're posting company secrets.
  fileExtension: 'md' // Optionally force a file extension if you don't want to rely on language-classifier.
}, function(err, resp, data) {
  console.log(data);
});

Returns a whole lot of useful info:

{
  url: 'https://api.github.com/gists/40cd13c18a50ca98c7eebd4cb79c8f95',
  forks_url: 'https://api.github.com/gists/40cd13c18a50ca98c7eebd4cb79c8f95/forks',
  commits_url: 'https://api.github.com/gists/40cd13c18a50ca98c7eebd4cb79c8f95/commits',
  id: '40cd13c18a50ca98c7eebd4cb79c8f95',
  git_pull_url: 'https://gist.github.com/40cd13c18a50ca98c7eebd4cb79c8f95.git',
  git_push_url: 'https://gist.github.com/40cd13c18a50ca98c7eebd4cb79c8f95.git',
  html_url: 'https://gist.github.com/40cd13c18a50ca98c7eebd4cb79c8f95',
  files: {
    'gist1.sh': {
      filename: 'gist1.sh',
      type: 'application/x-sh',
      language: 'Shell',
      raw_url: 'https://gist.githubusercontent.com/anonymous/40cd13c18a50ca98c7eebd4cb79c8f95/raw/2184df76232990bbc11109133d8a2b05715eb683/gist1.sh',
      size: 13,
      truncated: false,
      content: 'gists are fun'
    }
  },
  public: false,
  created_at: '2016-04-19T23:43:35Z',
  updated_at: '2016-04-19T23:43:35Z',
  description: null,
  comments: 0,
  user: null,
  comments_url: 'https://api.github.com/gists/40cd13c18a50ca98c7eebd4cb79c8f95/comments',
  forks: [],
  history: [{
    user: [Object],
    version: 'f5cd7f898c247772ece0fd4529fb80d2f4e2ee1e',
    committed_at: '2016-04-19T23:43:34Z',
    change_status: [Object],
    url: 'https://api.github.com/gists/40cd13c18a50ca98c7eebd4cb79c8f95/f5cd7f898c247772ece0fd4529fb80d2f4e2ee1e'
  }],
  truncated: false
}

Create multiple files by passing an array of content.

quickGist({
  content: [
    'this is the content of the first file in the gist',
    'this is the content of the second file',
    'oh look another file'
  ]
}, function(err, resp, data) {
  console.log(data);
});

License

MIT © Chris Contolini