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

ember-cli-version-checker

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-version-checker - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

9

index.js

@@ -27,3 +27,10 @@ 'use strict';

function assertAbove(addon, minimumVersion, message) {
function assertAbove(addon, minimumVersion, _message) {
var message = _message;
if (!message) {
message = 'The addon `' + addon.name + '` requires an Ember CLI version of ' + minimumVersion +
' or above, but you are running ' + getEmberCLIVersion(addon) + '.';
}
if (!isAbove(addon, minimumVersion)) {

@@ -30,0 +37,0 @@ var error = new Error(message);

4

package.json
{
"name": "ember-cli-version-checker",
"version": "1.0.0",
"version": "1.0.1",
"description": "Determine if your addon is being used by a minimum version of Ember CLI.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "mocha tests"
},

@@ -9,0 +9,0 @@ "author": "Robert Jackson <me@rwjblue.com>",

@@ -17,2 +17,15 @@ ### Ember CLI Version Checker

init: function() {
versionChecker.assertAbove(this, '2.0.0');
}
};
```
You can also provide a specific message as the third argument to `assertAbove` if you'd like to customize the output.
```javascript
var versionChecker = require('ember-cli-version-checker');
module.exports = {
name: 'awesome-addon',
init: function() {
versionChecker.assertAbove(this, '2.0.0', 'To use awesome-addon you must have ember-cli 2.0.0');

@@ -19,0 +32,0 @@ }

@@ -6,2 +6,3 @@ var assert = require('assert');

function FakeAddonAtVersion(version) {
this.name = 'fake-addon';
this.project = {

@@ -59,2 +60,11 @@ emberCLIVersion: function() {

describe('assertAbove', function() {
it('throws an error with a default message if a matching version was not found', function() {
var addon = new FakeAddonAtVersion('0.1.0');
var message = 'The addon `fake-addon` requires an Ember CLI version of 0.1.2 or above, but you are running 0.1.0.';
assert.throws(function() {
versionChecker.assertAbove(addon, '0.1.2',message);
}, new RegExp(message));
});
it('throws an error with the given message if a matching version was not found', function() {

@@ -61,0 +71,0 @@ var addon = new FakeAddonAtVersion('0.1.0');

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