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.3.0 to 0.3.1

11

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

@@ -13,11 +13,11 @@ "main": "dist/main.js",

"run-example": "node examples/main.js",
"build": "node ./build.js",
"prepare": "rm -rf dist && tsc"
"build": "rm -rf dist && tsc",
"prepare": "npm run build"
},
"dependencies": {
"json2csv": "^5.0.6"
"json2csv": "^5.0.6",
"type-fest": "^2.3.4"
},
"devDependencies": {
"@types/json2csv": "^5.0.3",
"esbuild": "^0.12.28",
"eslint": "^7.32.0",

@@ -27,5 +27,4 @@ "eslint-config-smarthr": "^5.0.3",

"prettier-config-smarthr": "^1.0.0",
"type-fest": "^2.3.4",
"typescript": "^4.4.3"
}
}

@@ -5,3 +5,3 @@ # comparing-dependencies

| library | prj1 | prj2 | prj3 |
| library | prj_01 | prj_02 | prj_03 |
| ----------- | ------- | ------- | ------- |

@@ -16,12 +16,54 @@ | dayjs | ^1.10.3 | ^1.10.2 | |

```sh
$ yarn add comparing-dependencies
```
yarn add comparing-dependencies
```
## API
### createCsv
```ts
createCsv(packageJsons: PackageJson[]): string
```
Note: `PackageJson` type is declared in [type-fest](https://github.com/sindresorhus/type-fest).
## Usage
```ts
createCsv(jsons: {}[]): string
import { createCsv } from 'comparing-dependencies'
const csv = createCsv([
{
name: 'proj_01',
dependencies: {
react: '^17.0.2',
dayjs: '^1.10.3',
webpack: '^5.51.1',
},
},
{
name: 'proj_02',
dependencies: {
react: '^17.0.2',
dayjs: '^1.10.2',
react-redux: '^7.2.4',
webpack: '^5.47.1',
},
},
{
name: 'proj_03',
dependencies: {
moment: '^2.29.1',
webpack: '^4.46.0',
},
},
])
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
```

@@ -28,0 +70,0 @@

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