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

ember-cli-gisty

v0.2.1

Published

Ember CLI addon for rendering GitHub Gists in templates

Downloads

10

Readme

ember-cli-gisty

Build Status

Ember CLI add-on for inserting :octocat: Gists within ember templates.

Table of Contents

Basic Information

Demo

Ember CLI Gisty Demo

Installation

ember install ember-cli-gisty

Usage

This add-on makes an Ember component available that will render the Gist in place when used in template.

For anonymous gists:

{{ember-gisty gist="ca8aa7061ab4fd6b70492e8eaf19addb"}}

For Gists created under a particular Github user:

{{ember-gisty user="shak" gist="ca8aa7061ab4fd6b70492e8eaf19addb"}}

For retrieving a particular file from a Gist:

{{ember-gisty user="shak" gist="ca8aa7061ab4fd6b70492e8eaf19addb" filename="controller.js"}}

Params

gist (required)

The hash for the Gist.

{{ember-gisty gist="ca8aa7061ab4fd6b70492e8eaf19addb"}}

user (optional) (default = "anonymous")

The Github user name if it is a private Gist. Assumes anonymous if no user provided.

{{ember-gisty user="shak"}}

filename (optional)

Will retrieve and render a particular file from a Gist when specified.

{{ember-gisty user="shak" gist="ca8aa7061ab4fd6b70492e8eaf19addb" filename="controller.js"}}

Advance Usage

Gisty yields isError and isLoading component states to allow you to show loading spinners or custom error messages in your templates.

isError (Boolean)

True when there is an error loading Gist.

{{#ember-gisty gist="ca8aa7061ab4fd6b70492e8eaf19addb" as |gisty|}}
  {{#if gisty.isError}}
    <p>There was an error loading Gist</p>
  {{/if}}
{{/ember-gisty}}

isLoading (Boolean)

True when the Gist is being retrieved from Github.

{{#ember-gisty gist="ca8aa7061ab4fd6b70492e8eaf19addb" as |gisty|}}
  {{#if gisty.isLoading}}
    <p>Be with you in a sec!</p>
  {{/if}}
{{/ember-gisty}}

fetch() (action)

Exposes action to retrieve Gist from Github, useful if you wish you to retry fetching a Gist.

{{#ember-gisty gist="ca8aa7061ab4fd6b70492e8eaf19addb" as |gisty|}}
  {{#if gisty.isError}}
    <p>There was an error loading Gist</p>
    <button {{action gisty.fetch}}>Click here to try again.</button>
  {{/if}}
{{/ember-gisty}}

License

ember-cli-gisty is released under an MIT license and is freely distributable.