electrode-io / Electrode Check Dependencies
An Electrode module to verify component dependencies against a list
Stars: ✭ 60
Programming Languages
javascript
184084 projects - #8 most used programming language
Electrode Check Dependencies
This module provides function to check a package.json
's dependencies against another list to make sure the package doesn't deviates from a uniform dependencies. This is mainly for ensuring React components use the same version of a common module when being consumed by an app.
Install
npm install electrode-check-dependencies
Usage
const CheckDep = require("electrode-check-dependencies");
CheckDep.checkPkgFile( "<component_package.json>", "<uniform_dep.json>" ).catch( (err) => {
console.log("component deviates from uniform dependencies");
});
or
const CheckDep = require("electrode-check-dependencies");
const component = require("./package.json").dependencies;
const check = require("./check.json").dependencies;
const result = CheckDep.checkDependencies( component, check );
if ( result.unsatisfyCommon.length > 0 || result.unexpected.length > 0 ) {
console.log("component deviates from uniform dependencies");
}
Built with ❤️ by Team Electrode @WalmartLabs.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].