Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

addons-moz-compare

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

addons-moz-compare

JS implementation to compare add-on versions.

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
49K
decreased by-8.06%
Maintainers
1
Weekly downloads
 
Created
Source

addons-moz-compare

CircleCI npm version

A JavaScript library to compare Mozilla add-on versions that follow the Manifest Version Format.

API

This library exposes a mozCompare() function that takes two (string) versions A and B and returns:

  • -1 if A < B
  • 0 if A == B
  • 1 if A > B

This implementation matches the Firefox implementation except that there are only 3 different possible return values (Firefox returns strictly negative and strictly positive values instead of -1 and 1).

Usage

npm i addons-moz-compare

or

yarn add addons-moz-compare

Node

const { mozCompare } = require('addons-moz-compare');

Browser

Use window.mozCompare after having included the source of this library.

License

This plugin is released under the Mozilla Public License Version 2.0. See the bundled LICENSE file for details.

FAQs

Package last updated on 03 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc