New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jscmp

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jscmp - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

src/handlers/csvHandler.js

5

package.json
{
"name": "jscmp",
"version": "0.0.3",
"version": "0.0.4",
"description": "Compare two JSON/JS files to find the diff between their exported objects",

@@ -24,3 +24,4 @@ "author": "Ayush Gupta <AyushG3112@gmail.com>",

"arg": "^4.1.3",
"esm": "^3.2.25"
"esm": "^3.2.25",
"json2csv": "^4.5.4"
},

@@ -27,0 +28,0 @@ "devDependencies": {},

16

Readme.md
# jscmp
Compare two JSON/JS files to find the diff between their exported objects
Compare two JSON/JS files to find the diff between their exported objects
## Usage
To install
``` console
npm i -g jscmp
```
To Use:
``` console
jscmp /path/to/fileA /path/to/fileB [--mode=json|csv --out-file=/path/to/out-file] [-q] [--esm]
```

@@ -59,2 +59,2 @@ import arg from "arg";

export default new CommandLineArguments().build(process.argv);
export default new CommandLineArguments();

@@ -6,3 +6,3 @@ require = require("esm")(module /*, options*/);

export function cli(args) {
export async function cli(args) {
const cliArgs = argumentParser.build(args);

@@ -12,3 +12,3 @@ const errors = cliArgs.validate();

const result = process(...cliArgs.args.files, cliArgs);
getHandler(cliArgs).handle(result);
await (getHandler(cliArgs.args).handle(result));
} else {

@@ -15,0 +15,0 @@ throw new Error(errors[0]);

@@ -7,2 +7,9 @@ class DefaultHandler {

handle(input = []) {
if (!input.length) {
return;
}
if (input.length) {
console.log(`fileA: ${input[0].fileA}`);
console.log(`fileB: ${input[0].fileB}\n`);
}
for (let item of input) {

@@ -9,0 +16,0 @@ switch (item.type) {

import DefaultHandler from "./defaultHandler";
import JSONHandler from "./jsonHandler";
import CSVHandler from "./csvHandler";
export default function getHandler(options = {}) {
return new DefaultHandler(options);
switch (options.mode) {
case "json":
return new JSONHandler(options);
case "csv":
return new CSVHandler(options);
default:
return new DefaultHandler(options);
}
}
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