Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

comparing-dependencies

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

comparing-dependencies - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

dist/jest.config.d.ts

23

package.json
{
"name": "comparing-dependencies",
"version": "0.4.0",
"version": "0.4.1",
"description": "This library outputs the comparison results of depending libraries as a CSV file.",

@@ -12,18 +12,23 @@ "main": "dist/main.js",

"scripts": {
"run-example": "node examples/main.js",
"run-example": "npm run build && node examples/main.js",
"build": "rm -rf dist && tsc",
"prepare": "npm run build"
"test": "NODE_OPTIONS=--experimental-vm-modules jest "
},
"dependencies": {
"json2csv": "^5.0.6",
"type-fest": "^2.3.4"
"json2csv": "^5.0.7",
"type-fest": "^2.13.1"
},
"devDependencies": {
"@swc/core": "^1.2.204",
"@swc/jest": "^0.2.21",
"@types/jest": "^28.1.3",
"@types/json2csv": "^5.0.3",
"eslint": "^7.32.0",
"eslint-config-smarthr": "^5.0.3",
"prettier": "^2.4.1",
"eslint": "^8.18.0",
"eslint-config-smarthr": "^6.0.7",
"jest": "^28.1.1",
"prettier": "^2.7.1",
"prettier-config-smarthr": "^1.0.0",
"typescript": "^4.4.3"
"ts-node": "^10.8.1",
"typescript": "^4.7.4"
}
}
# comparing-dependencies
This is a npm library that imports multiple package.json files and 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.

@@ -27,3 +27,3 @@ | library | prj_01 | prj_02 | prj_03 |

## Usage
### Usage

@@ -35,6 +35,8 @@ ```ts

{
name: 'proj_01',
name: 'prj_01',
dependencies: {
react: '^17.0.2',
dayjs: '^1.10.3',
},
devDependencies: {
webpack: '^5.51.1',

@@ -44,3 +46,3 @@ },

{
name: 'proj_02',
name: 'prj_02',
dependencies: {

@@ -50,2 +52,4 @@ react: '^17.0.2',

react-redux: '^7.2.4',
},
devDependencies: {
webpack: '^5.47.1',

@@ -55,3 +59,3 @@ },

{
name: 'proj_03',
name: 'prj_03',
dependencies: {

@@ -65,13 +69,40 @@ moment: '^2.29.1',

console.log(csv)
// library,proj_01,proj_02,proj_03
// dayjs,^1.10,3,,
// 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
// "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"
```
## Examples
## Example codes
- [Examples for comparing-dependencies](./examples)
### Replacing package.json files
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.
### Running
```sh
$ yarn run-example
```
### Checking the result
The `result.csv` will be output at the `./examples`.
```sh
$ open ./examples/result.csv
```
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