github-widget-lite

0.2.5 • Public • Published

Github Widget Lite

NPM License Downloads

Based on JoelSutherland/GitHub-jQuery-Repo-Widget.

Rewritten to drop unnecessary dependencies.

Installation

  • NPM

    $ npm install github-widget-lite

Usage

  • Load via HTML:

    <script src="dist/github-widget.js"></script>
    <div class="github-widget" data-repo="gera2ld/github-widget-lite"></div>

    The widget container MUST have a className of github-widget.

  • Load via JavaScript dynamically:

    <div data-repo="gera2ld/github-widget-lite"></div>
    • Via global

      <script src="dist/github-widget.js"></script>
      var container = document.querySelector('[data-repo]');
      window.githubWidgets.loadWidget(container);
    • Via CMD

      var container = document.querySelector('[data-repo]');
      var githubWidgets = require('github-widget-lite');
      githubWidgets.loadWidget(container);
    • Via jQuery

      // If jQuery is not global, initalize with jQuery manually
      githubWidgets.initJQuery(jQuery);
      
      $('[data-repo]').githubWidgets();

Demo

Go

Readme

Keywords

Package Sidebar

Install

npm i github-widget-lite

Weekly Downloads

2

Version

0.2.5

License

MIT

Last publish

Collaborators

  • gera2ld