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

@freedomofspeech/chrome-extension

v0.0.0

Published

[Google chrome extension](http://developer.chrome.com/extensions/index.html) skeleton, based on * [angular.js](http://angularjs.org) * [require.js](https://github.com/karma-runner/karma)

Downloads

7

Readme

chrome-extension-skeleton-ng

Google chrome extension skeleton, based on

Main features:

  • js-modules via require.js
  • angular.js (popup page, options page)
  • deploy script (automatically create crx file)
  • logging (one central extension log from all content/background pages)
  • localStorage-base configuration
  • unit-tests (mocha, karma)
  • end to end test (TBD, if possible)

Directory structure

/code
    /css
    /html
        /templates
    /images
    /js
        /lib
            /angular
        /modules
            /background
                /controllers
            /content
                /controllers
            /util
/tests
    /pure-unit
        /modules
        /specs

In code directory you will find:

  • css - any css files used by the extension
  • html - any html files used by the extension
  • html/templates - html Angular templates used for rendering html code
  • images - any graphics used by the extnesion
  • js - code javascript files (entry point for background script, content script(s), and popup script
  • js/lib - third party libraries, see README.md file there for details
  • js/modules - all extension-specific code in AMD modules (can be organised in sub-directories)
  • js/modules/background - Angular.js application for background pages
  • js/modules/content - Angular.js application for content pages
  • js/util - common functionality (messaging and templates) for the extensions, written as AMD modules

In tests\pure-unit directory you will find: test related JavaScript code for mocha-node

  • modules - unit test-specific utility and RequireJS configuration
  • specs - unit test modules

Run deploy

  cd deploy
  ./makecrx.sh
  cp deploy/pkg/chrome-angular-extension-0.0.1.crx to_some_test

The script deploy/makecrx.sh will create (once) deploy\dummy-chromium.pem private key for google chrome extension. Please don't commit it to public if you don't want.

Run unit-test

NOTE: We have to plan that end-2-end and unit tests with karma will work ok, but it is not worked now.

Unit-test with mocha/require.js (but without angular) works ok:

  1. Install mocha-node first:

npm install -g mocha

  1. In tests\pure-unit\ directory run run-tests.sh (it installs required dependencies first)

How to debug without deploy

  1. Open chrome
  2. Go to chrome://extensions/
  3. Switch ON for checkbox Developer mode
  4. Press Load unpacked extension... and specify /code folder

How to get console logs

All pages send log to background page, so it is enough to open bg page console logs.

  1. Open chrome
  2. Go to chrome://extensions/
  3. Find Chrome Angular extension with require.js
  4. Go to extension's html/background.html
  5. Switch to Console

Useful links:

  • Daniel Prentis
    RequireJS In Chrome Extensions
    http://prezi.com/rodnyr5awftr/requirejs-in-chrome-extensions/

  • Salsita
    Original chrome-skeleton with require.js
    https://github.com/salsita/chrome-extension-skeleton

  • Fork of Angular Seed but with changes needed for requireJS support.
    https://github.com/tnajdek/angular-requirejs-seed

  • Mark Tucker
    Chrome Extension using AngularJS - Part 1
    http://www.youtube.com/watch?v=Bxg-5C3F8qo

  • Mark Tucker
    Chrome Extension using AngularJS - Part 2: Services
    http://www.youtube.com/watch?v=1O6YTz1yU10

  • How to test e2e google chrome extension with karma?
    http://stackoverflow.com/questions/17369462/how-to-test-e2e-google-chrome-extension-with-karma