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

gorgias

v2.9.2

Published

Gorgias grunt package

Downloads

5

Readme

Gorgias Chrome Extension

Google Chrome plugin for improved productivity on the web.

Sites supported

  • Gmail
  • Outlook.com
  • Yahoo Mail
  • Linkedin

Developing extension

Development is done using Grunt. So first you need to install Node.js and Grunt.

There are available following commands:

  • grunt or grunt dev or grunt d - Development mode. Creates development manifest, watches for styl files and recompiles them automatically.
  • grunt production or grunt p - Build extension.
  • grunt test or grunt t - Run tests.
  • grunt build or grunt b - Build and compress extension.

Known issues

  1. Saving a template from the context menus doesn't work with multi-lines.

    Relevant bug: https://code.google.com/p/chromium/issues/detail?id=116429

    This means that when selecting a text to save as a template it will not preserve newlines.

Creating templates

Templates are powered by handlebars.js.

Following template variables are available:

  • subject string
  • from list; Each list element contains:
    • name string
    • firt_name string
    • last_name string
    • email string
  • to list similar to from
  • cc list similar to from
  • bcc list similar to from

To output a string use following syntax:

String variables are denoted by double curly braces: {{subject}}

If subject is My email subject then it be rendered to:

String variables are denoted by double curly braces: My email subject

To output a list use following syntax:

To:
{{#each to}}
- Name {{name}}
- First name {{first_name}}
- Last name {{last_name}}
- Email {{email}}
{{/each}}

You also may want to output list only if it has values:

{{#if to}}
To:
{{#each to}}
- Name {{name}}
- First name {{first_name}}
- Last name {{last_name}}
- Email {{email}}
{{/each}}
{{/if}}

If you want to output only second element from list (note that list numbering starts with 0):

{{#if to.[1]}}
Second To:
- Name {{to.1.name}}
- First name {{to.1.first_name}}
- Last name {{to.1.last_name}}
- Email {{to.1.email}}
{{/if}}

Building plugins

You can build plugins using the App.plugin('PLUGIN_NAME', {}) method.

Check out the src/content/plugins/*.js files for examples on how a plugin show look.

Each plugin must expose the following methods:

  • init
  • getData

All plugin methods should take two arguments: params and callback.

The params argument is an object which can contain other objects or properties that you can use in the method.

The callback argument should be a function called at the end of the method, after all async functionality.

The callback function uses Node.js-style arguments. The first one is an error object returned in case of errors, otherwise return null. The second argument is the actual method response.

Plugin methods

init

The init method should respond with a boolean value, false by default, and true if the plugin should be activated.

getData

The getData method receives the following params object:

params: {
    element: DOM_ELEMENT
}

The params.element object is a reference to the DOM element on which the autocomplete was triggered. It can be a contenteditable element, or a form element.

The response of the getData method should look like:

{
    from: [],
    to: [],
    cc: [],
    bcc: [],
    subject: ''
}

Each array should contain objects that look like:

{
    name: '',
    first_name: '',
    last_name: '',
    email: ''
}

setTitle

// TODO

Testing

Before running the tests, run:

npm install

Then key your Chrome private .pem keyfile and copy it as key.pem in the repository root.

Set the QUICKTEXT_GMAIL_USERNAME and QUICKTEXT_GMAIL_PASSWORD ENV variables, for logging-in into Gmail.

export QUICKTEXT_GMAIL_USERNAME=abc
export QUICKTEXT_GMAIL_PASSWORD=def

Then, to run all the tests:

grunt test

or only for the contentscript:

grunt test:content

or only for the background script:

grunt test:background

Running the tests will recompile the app for production and test that.

If you want to run the tests locally (not on Sauce Labs) without recompiling the app, run:

grunt protractor:background

or

grunt protractor:content