Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
comparing-dependencies
Advanced tools
This library outputs the comparison results of depending libraries as a CSV file.
This is a npm library that imports multiple package.json files and outputs the comparison results of depending libraries as a CSV format string.
library | prj_01 | prj_02 | prj_03 |
---|---|---|---|
dayjs | ^1.10.3 | ^1.10.2 | |
moment | ^2.29.1 | ||
react | ^17.0.2 | ^17.0.2 | |
react-redux | ^7.2.4 | ||
webpack | ^5.51.1 | ^5.47.1 | ^4.46.0 |
$ yarn add comparing-dependencies
createCsv(packageJsons: PackageJson[]): string
Note: PackageJson
type is declared in type-fest.
import { createCsv } from 'comparing-dependencies'
const csv = createCsv([
{
name: 'prj_01',
dependencies: {
react: '^17.0.2',
dayjs: '^1.10.3',
},
devDependencies: {
webpack: '^5.51.1',
},
},
{
name: 'prj_02',
dependencies: {
react: '^17.0.2',
dayjs: '^1.10.2',
react-redux: '^7.2.4',
},
devDependencies: {
webpack: '^5.47.1',
},
},
{
name: 'prj_03',
dependencies: {
moment: '^2.29.1',
webpack: '^4.46.0',
},
},
])
console.log(csv)
// "library","prj_01","prj_02","prj_03"
// "dayjs","^1.10.3","^1.10.2",""
// "moment","","","^2.29.1"
// "react","^17.0.2","^17.0.2",""
// "react-redux","","^7.2.4",""
// "webpack","^5.51.1","^5.47.1","^4.46.0"
Place the package.json files that you want to compare under the ./examples/inputs
directory. Then, the name
field in each package.json will be output as a column name in the CSV.
examples/inputs/
|- example_package_01.json
|- example_package_02.json
|- example_package_03.json
These file names can be anything you want.
$ yarn run-example
The result.csv
will be output at the ./examples
.
$ open ./examples/result.csv
FAQs
This library outputs the comparison results of depending libraries as a CSV file.
We found that comparing-dependencies 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.