comparing-dependencies
Advanced tools
Comparing version 0.3.0 to 0.3.1
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3592
6
72
2
+ Addedtype-fest@^2.3.4
+ Addedtype-fest@2.19.0(transitive)