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

dpacker

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dpacker - npm Package Compare versions

Comparing version 1.0.51 to 1.1.0

dist/unpack.js

12

dist/index.js

@@ -1,2 +0,1 @@

#!/usr/bin/env node
"use strict";

@@ -11,3 +10,3 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

const js_beautify_1 = __importDefault(require("js-beautify"));
const webpack_unpack_1 = __importDefault(require("webpack-unpack"));
const unpack_js_1 = __importDefault(require("./unpack.js"));
const currDir = process.cwd();

@@ -22,3 +21,4 @@ const outDir = path_1.default.join(currDir, "out");

const dirName = process.argv[2];
const beautifyIt = process.argv[3] === "-b";
const beautifyIt = process.argv[3] === "-b" || process.argv[4] === "-b";
const allowDuplicates = process.argv[3] === "-d" || process.argv[4] === "-d";
const files = fs_1.default.readdirSync(dirName);

@@ -29,3 +29,3 @@ for (const inFile of files) {

const fileData = fs_1.default.readFileSync(inPath).toString();
const data = webpack_unpack_1.default(fileData);
const data = unpack_js_1.default(fileData);
if (!data)

@@ -35,2 +35,4 @@ continue;

const newFileName = genNewFilePath(item.id);
if (newFileName === undefined)
continue;
const newFile = path_1.default.join(outDir, `${newFileName}.js`);

@@ -49,2 +51,4 @@ console.log(newFile);

return fileName;
if (!allowDuplicates)
return undefined;
const p = path_1.default.join(outDir, `${fileName}-${i}.js`);

@@ -51,0 +55,0 @@ if (fs_1.default.existsSync(p)) {

{
"name": "dpacker",
"version": "1.0.51",
"version": "1.1.0",
"main": "dist/index.js",

@@ -18,13 +18,18 @@ "license": "MIT",

"dependencies": {
"acorn": "^8.7.0",
"assert": "^2.0.0",
"astring": "^1.8.1",
"js-beautify": "^1.14.0",
"multisplice": "^1.0.0",
"rimraf": "^3.0.2",
"webpack-unpack": "^2.0.0"
"scope-analyzer": "^2.1.2"
},
"devDependencies": {
"@types/js-beautify": "^1.13.2",
"@types/estree": "^0.0.51",
"@types/js-beautify": "^1.13.3",
"@types/node": "^16.4.7",
"@types/rimraf": "^3.0.1",
"@types/rimraf": "^3.0.2",
"ts-node": "^10.1.0",
"typescript": "^4.3.5"
}
}
}

@@ -15,7 +15,11 @@ # DPacker

```shell
npx dpacker ./assets-canary [-b]
npx dpacker ./assets-canary [-b] [-d]
```
the `-b` is optional, and will auto-beautify the JS files as they're written.
## Flags:
`-b` is optional, and will auto-beautify the JS files as they're written.
`-d` is optional, and will write duplicate files if they share the ID. (By default, it ignores duplicate files as there's usually not any difference)
The files will be written into an `out` folder :)

@@ -5,3 +5,3 @@ import fs from "fs";

import jsBeautify from "js-beautify";
import unpack from "webpack-unpack";
import unpack from "./unpack.js";

@@ -23,3 +23,4 @@ const currDir = process.cwd();

const beautifyIt = process.argv[3] === "-b";
const beautifyIt = process.argv[3] === "-b" || process.argv[4] === "-b";
const allowDuplicates = process.argv[3] === "-d" || process.argv[4] === "-d";

@@ -40,2 +41,3 @@ const files = fs.readdirSync(dirName);

const newFileName = genNewFilePath(item.id);
if (newFileName === undefined) continue;
const newFile = path.join(outDir, `${newFileName}.js`);

@@ -57,2 +59,4 @@ console.log(newFile);

if (!allowDuplicates) return undefined;
const p = path.join(outDir, `${fileName}-${i}.js`);

@@ -59,0 +63,0 @@

@@ -11,2 +11,3 @@ {

"esModuleInterop": true,
"allowJs": true,
"moduleResolution": "Node",

@@ -17,3 +18,4 @@ "baseUrl": ".",

},
"include": ["src/**/*", "types/types.d.ts"]
"include": ["src/**/*", "types/types.d.ts"],
"exclude": ["node_module"]
}
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