
Research
/Security News
Fake imToken Chrome Extension Steals Seed Phrases via Phishing Redirects
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.
codependence
Advanced tools
Checks `codependencies` in package.json files to ensure dependencies are up-to-date 🤼♀️
Codependence is a JavaScript utility for checking dependencies to ensure they're up-to-date or match a specified version.
Codependence updates package.json's dependencies based on a "codependencies" array of dependency names.
The difference from {npm,pnpm} update or yarn upgrade is Codependence allows you to pin what you want and update the rest!
Furthermore, Codependence works with monorepos and is package manager agnostic.
~ or ^ versions in package.json files!Readme more about Codependence why you might want to use it below!
Codependence can be used as a standalone CLI, in npm scripts or, secondarily, as node utility!
npm install codependence --save-dev
Pure CLI quick run
codependence --condependencies 'fs-extra' 'lodash'
Or use it with a config in the root package.json file
{
"codependence": {
"condependencies": ["fs-extra", "lodash"]
},
"scripts": {
"update-codependencies": "codependence --update",
"prepare": "npm run update-codependencies"
}
}
Codependence is built as a CLI-first, set-it-and-forget-it tool.
It is recommendeded to install and setup Codependence as a devDependency within your root package.json and use a codependence.codependencies array to define dependencies you need to keep updated or pinned to a specific version.
Furthermore, you can add a codependence.codependencies array to child packages' package.json in your monorepo to ensure specific dependencies are pinned to a specific versions within your monorepo packages.
Usage: program [options]
Codependency, for code dependency. Checks `codependencies` in package.json files to ensure dependencies are up-to-date
Options:
-f, --files [files...] file glob pattern
-u, --update update dependencies based on check
-r, --rootDir <rootDir> root directory to start search
-i, --ignore [ignore...] ignore glob pattern
--debug enable debugging
--silent enable mainly silent logging
-cds, --codependencies [codependencies...] a path to a file with a codependenies object
-c, --config <config> accepts a path to a config file
-s, --searchPath <searchPath> a search path string for locationing config files
-h, --help display help for command
Although, Codependence is built to primarily be a CLI utility, it can be used as a node utility.
import codependence from 'codependence'
const checkForUpdate = async () => {
const isLatest = await codependence({ codependencies: ['fs-extra', 'lodash'] })
if (!isLatest) {
console.log('This repo is update-to-date')
} else {
console.error('This repo is not update-to-date')
}
}
checkForUpdate()
Codependence options can be used via CLI options, a config file read from the CLI, or with node by passing them into exported Codependence functions. Read more below!
codependencies: Array<string | Record<string, string>A required option or *config array! Codependencies are required via being passed in an array as a cli option **or as within a codependence.codependencies array.
undefinedThe Codependence codependencies array supports latest out-of-the-box.
So having this
["fs-extra", "lodash"]will return thelatestversions of the packages within the array. It will also match a specified version, like so[{ "foo": "1.0.0" }]and[{ "foo": "^1.0.0" }]or[{ "foo": "~1.0.0" }]. You can also include a*at the end of a name you would like to match. For example,@foo/*will match all packages with@foo/in the name and return their latest versions. This will also work withfoo-*, etc.
Codependence is built in to give you more capability to control your dependencies!
codependence.codependencies array in Monorepo child packagesYou can add a codependence.codependencies array to child packages in your monorepo to ensure specific dependencies are pinned to a specific different versions within your monorepo packages.
You can have a package.json file in a @foo/bar package with following:
{
"name": "@foo/bar",
"dependencies": {
"fs-extra": "^9.0.0",
},
"codependence": {
"codependencies": [{ "fs-extra": "^9.0.0" }]
}
}
And another package.json file in a @foo/baz package with following:
{
"name": "@foo/baz",
"dependencies": {
"fs-extra": "^11.1.0",
},
"codependence": {
"codependencies": [{ "fs-extra": "^11.1.0" }]
}
}
Codependencies will install the right dependency version for each package in your monorepo!
Note: Codependencies can and will still install the expected version defined at the monorepo's root for packages that don't specify differences in their
package.jsonfiles!
files: Array<string>An optional array of strings to check for package.json files to update.
['package.json']["package.json", "**/package.json"update: booleanAn optional boolean which defines whether Codependence should update dependencies in package.json's or not.
falserootDir: stringAn optional string which can used to specify the root directory to run checks from;
"./"ignore: Array<string>An optional array of strings used to specify directories to ignore
["node_modules/**/*", "**/node_modules/**/*"]debug: booleanAn optional boolean value used to enable debugging output
falsesilent: booleanAn optional boolean value used to enable a more silent developer experience
falseconfig: stringAn optional string containing a package to file which contains codependence config.
undefinedsearchPath: stringAn optional string containing a search path for location config files.
undefinedyarnConfig: booleanAn optional boolean value used to enable *yarn config checking
falseListed below are some common patterns (recipes) for using Codependence.
Starting out, you may not want a config object. Have no fear, Codependence can be used as a CLI utility ONLY!
codependence --codependencies 'lodash' '{ \"fs-extra\": \"10.0.1\" }'
<name>* (name star) pattern to return the latest version of them? Sure!codependence --codependencies '@foo/*' --update
Codependence is a JavaScript utility CLI and node tool that compares a codependencies array against package.json dependencies, devDependencies, and peerDependencies for *codependencies.
For each dependency included in the codependencies array, Codependence will either a) check that versions are at latest or b) Check that a specified version is matched within package.json files. Codependence can either a) return a pass/fail result or b) update dependencies, devDependencies, and peerDependencies, in package.json file(s).
Codependence is useful for ensuring specified dependencies are up-to-date—or at a specified version within a project's package.json files(s)!
This utility is built to work alongside dependency management tools like dependabot. It could work instead of dependency management tool but is built for managing specific dependency versions vs all dependencies.
In example, if your repository requires the latest version and latest can't be specified as the dependency version within your package.json, Codependence will ensure your package.json has the actual latest semver version set in your package.json. It can/will do the same if an exact version is specified!
Codependence is a utility tool focused on a single task—managing specified dependency versions!
Codependence isn't for everybody or every repository. Here are some reasons why it might not be for you!
latest, or manually pinning, or using a tool like Dependabot's ignore spec within a dependabot.yml.Check out Codependence in Action!
private packagesIf there is a .npmrc file, there is no issue with Codependence monitoring private packages. However, if a yarn config is used, Codependence must be instructed to run version checks differently.
--yarnConfig option.yarnConfig: true to your options or your config.Contributing is straightforward.
nvm install && npm install pnpm && pnpm install
Thank you!
Thanks to Dev Wells and Steve Cox for the aligned code leading to this project. Thanks Navid for some great insights to improve the api!
Made by @yowainwright, MIT 2022
FAQs
Checks `codependencies` in package.json files to ensure dependencies are up-to-date 🤼♀️
The npm package codependence receives a total of 3,094 weekly downloads. As such, codependence popularity was classified as popular.
We found that codependence demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
/Security News
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.

Security News
Latio’s 2026 report recognizes Socket as a Supply Chain Innovator and highlights our work in 0-day malware detection, SCA, and auto-patching.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.