IMPORTANT UPDATE AS OF 2019-11-26: The jpm
package and its libraries are no longer maintained as Firefox no longer supports add-ons built with jpm
. If you're building a new add-on, consider a
WebExtension
instead and check out the web-ext
tool which has all the same features as jpm
. Here are some
resources
to help you migrate a legacy jpm
built add-on.
Takes a Jetpack addon manifest object and returns a properly formatted ID for the addon. Works with cfx and jpm and any Jetpack addon that uses a package.json
.
var getID = require("jetpack-id");
getID({ name: "my-addon" }); // "@my-addon"
getID({ id: "tab-fixer@addon" }); // "tab-fixer@addon"
// Manifest's generated by cfx generate an ID that is invalid -- this
// should be manually changed to be compatable with AMO by appending
// a `@jetpack` at the end, and this module does NOT do that.
getID({ id: "jid1-JtUwP0fsy08AKw" }); // null
npm install jetpack-id
MPL 2.0 License, copyright (c) 2014 Jordan Santell