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

amo-upload

v0.6.1

Published

Upload add-on to AMO

Downloads

72

Readme

amo-upload

NPM License Downloads

Upload your web extension to AMO and get the download URL after being signed.

Note: This package only provides ES module, see here for more details.

Highlights

  • Upload zipped extension file
  • Optionally upload source code for review
  • Idempotent commands, CI friendly
  • List all version statuses with a single command

Command-line Usage

The following options can also be loaded from environment variables:

| Global Option | Environment Variable | |--------------------|----------------------| | --api-key | AMO_KEY | | --api-secret | AMO_SECRET | | --api-url-prefix | AMO_URL_PREFIX | | --addon-id | AMO_ADDON_ID |

Note: the command-line options take precedence over the environment variables.

Upload and Sign

$ npx amo-upload \
  sign \
  --api-key $API_KEY \
  --api-secret $API_SECRET \
  --addon-id $ADDON_ID \
  --addon-version $VERSION \
  --channel listed \
  --dist-file path/to/dist.zip \
  --source-file path/to/source.zip
  --output path/to/my-ext-v1.2.3.xpi

For listed channel, we don't wait for the signed package if no output is specified. The output will be the filename of the package.

For unlisted channel, we will wait for the package to be signed. After the signed file is downloaded, the path of the downloaded file will be printed to the console. Otherwise an error will be thrown.

List Statuses

image

# List all public versions
$ npx amo-upload list

# List all listed and unlisted versions
$ npx amo-upload list --filter all_with_unlisted

See the documentation for more details about filter.

API

import { signAddon } from 'amo-upload';

try {
  const output = await signAddon({
    apiKey,
    apiSecret,
    addonId,
    addonVersion,
    channel: 'listed',
    distFile: 'path/to/dist.zip',
    sourceFile: 'path/to/source.zip',
    output: 'path/to/my-ext-v1.2.3.xpi',
  });
  console.info('The signed file is stored at:', output);
} catch (err) {
  console.error('File not signed yet');
}

References

  • addons-server: https://addons-server.readthedocs.io/en/latest/index.html