Socket
Socket
Sign inDemoInstall

engine-asserts

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

engine-asserts

Verifier for nodejs and mongdb versions


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
3
Weekly downloads
 
Created
Source

Engine Asserts

Simple nodejs module that allow you to verify if enviroment version of node/mongodb matches version specified in your package.json/.nvmrc

Installation

As expected, you can install via npm:

$ npm install engine-asserts

Example Usage

insert following code in your package.json .nvmrc


//package.json
...
{
  "engines": {
    "node": "1.0.0",
    "mongodb": "3.2.1"
  }
}
...

// or .nvmrc
5.5.0

You can then use in your Node apps:

//your app.js

/**
 *
 * @param {Object} [cfg]
 * @param {Boolean} [cfg.consoleDisabled]       disable console output (default: false)
 * @param {String} [cfg.rootPath]               path to package.jsn & .nvmrc directory (default: process.cwd())
 */
var engineAsserts = require('engine-asserts')(cfg);


/**
 *
 * @param {Boolean} justWarn            true - displays error output in console
 *										false - displays error output in console and  * @returns {Boolean}
 */
engineAsserts.checkNodeVersion(justWarn);


/**
 *
 * @param {Boolean} justWarn            true - displays error output in console ,
 *										false - displays error output in console and exits process
 * @returns {Q.Promise}
 */
engineAsserts.checkMongoVersion(justWarn);



You can run tests:

$ npm run test

Keywords

FAQs

Package last updated on 31 Mar 2018

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