Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
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.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.