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

@node-minify/core

Package Overview
Dependencies
Maintainers
0
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@node-minify/core - npm Package Compare versions

Comparing version 9.0.2 to 10.0.0-next.0

dist/index.cjs

1

dist/index.d.ts

@@ -15,1 +15,2 @@ import { Settings } from '@node-minify/types';

export { minify as default };
export = minify

80

dist/index.js

@@ -1,29 +0,5 @@

"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// src/compress.ts
var import_node_fs = __toESM(require("fs"));
var import_utils = require("@node-minify/utils");
var import_mkdirp = require("mkdirp");
import fs from "node:fs";
import { utils } from "@node-minify/utils";
import { mkdirp } from "mkdirp";
var compress = (settings) => {

@@ -41,8 +17,8 @@ if (typeof settings.compressor !== "function") {

}
return import_utils.utils.compressSingleFile(settings);
return utils.compressSingleFile(settings);
};
var compressArrayOfFilesSync = (settings) => {
return Array.isArray(settings.input) && settings.input.forEach((input, index) => {
const content = import_utils.utils.getContentFromFiles(input);
return import_utils.utils.runSync({ settings, content, index });
const content = utils.getContentFromFiles(input);
return utils.runSync({ settings, content, index });
});

@@ -53,5 +29,5 @@ };

Array.isArray(settings.input) && settings.input.forEach((input, index) => {
const content = import_utils.utils.getContentFromFiles(input);
const content = utils.getContentFromFiles(input);
sequence = sequence.then(
() => import_utils.utils.runAsync({ settings, content, index })
() => utils.runAsync({ settings, content, index })
);

@@ -69,4 +45,4 @@ });

}
if (!import_node_fs.default.statSync(dir).isDirectory()) {
import_mkdirp.mkdirp.sync(dir);
if (!fs.statSync(dir).isDirectory()) {
mkdirp.sync(dir);
}

@@ -76,3 +52,3 @@ };

// src/compressInMemory.ts
var import_utils2 = require("@node-minify/utils");
import { utils as utils2 } from "@node-minify/utils";
var compressInMemory = (settings) => {

@@ -84,9 +60,9 @@ if (typeof settings.compressor !== "function") {

}
return import_utils2.utils.compressSingleFile(settings);
return utils2.compressSingleFile(settings);
};
// src/setup.ts
var import_node_path = __toESM(require("path"));
var import_utils3 = require("@node-minify/utils");
var import_glob = require("glob");
import path from "node:path";
import { utils as utils3 } from "@node-minify/utils";
import fg from "fast-glob";
var defaultSettings = {

@@ -100,3 +76,3 @@ sync: false,

let settings = Object.assign(
import_utils3.utils.clone(defaultSettings),
utils3.clone(defaultSettings),
inputSettings

@@ -139,3 +115,3 @@ );

const outputMin = input.map(
(file) => import_utils3.utils.setFileNameMin(
(file) => utils3.setFileNameMin(
file,

@@ -150,3 +126,3 @@ output,

return {
output: import_utils3.utils.setFileNameMin(
output: utils3.setFileNameMin(
input,

@@ -184,3 +160,3 @@ output,

if (isWildcardsPresent) {
output.input = (0, import_glob.globSync)(inputWithPublicFolder);
output.input = fg.globSync(inputWithPublicFolder);
}

@@ -198,3 +174,3 @@ for (let i = 0; i < output.input.length; i++) {

if (input.indexOf("*") > -1) {
output = (0, import_glob.globSync)((publicFolder || "") + input);
output = fg.globSync((publicFolder || "") + input);
}

@@ -208,13 +184,13 @@ return output;

}
publicFolder = import_node_path.default.normalize(publicFolder);
publicFolder = path.normalize(publicFolder);
if (Array.isArray(input)) {
output.input = input.map((item) => {
if (import_node_path.default.normalize(item).indexOf(publicFolder) > -1) {
if (path.normalize(item).indexOf(publicFolder) > -1) {
return item;
}
return import_node_path.default.normalize(publicFolder + item);
return path.normalize(publicFolder + item);
});
return output;
}
input = import_node_path.default.normalize(input);
input = path.normalize(input);
if (input.indexOf(publicFolder) > -1) {

@@ -224,3 +200,3 @@ output.input = input;

}
output.input = import_node_path.default.normalize(publicFolder + input);
output.input = path.normalize(publicFolder + input);
return output;

@@ -271,3 +247,6 @@ };

minify.default = minify;
module.exports = minify;
var src_default = minify;
export {
src_default as default
};
/*!

@@ -278,2 +257,1 @@ * node-minify

*/
//# sourceMappingURL=index.js.map
{
"name": "@node-minify/core",
"version": "9.0.2",
"version": "10.0.0-next.0",
"description": "core of @node-minify",

@@ -11,6 +11,7 @@ "keywords": [

"author": "Rodolphe Stoclin <srodolphe@gmail.com>",
"homepage": "https://github.com/srod/node-minify/tree/master/packages/core#readme",
"homepage": "https://github.com/srod/node-minify/tree/main/packages/core#readme",
"license": "MIT",
"type": "module",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"
},

@@ -21,10 +22,8 @@ "directories": {

},
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"main": "./dist/index.cjs",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
"import": "./dist/index.js",
"default": "./dist/index.cjs"
}

@@ -45,19 +44,21 @@ },

},
"dependencies": {
"glob": "10.3.3",
"mkdirp": "3.0.1",
"@node-minify/utils": "9.0.1"
},
"devDependencies": {
"@types/mkdirp": "^1.0.2",
"@node-minify/types": "9.0.0"
},
"scripts": {
"clean": "pnpm dlx rimraf dist",
"build": "pnpm clean && tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
"build": "tsup src/index.ts --format cjs,esm --dts --clean && bunx fix-tsup-cjs",
"check-exports": "attw --pack .",
"format:check": "biome check .",
"lint": "biome lint .",
"prepublishOnly": "bun run build",
"test": "vitest run",
"test:ci": "vitest run --coverage",
"test:watch": "vitest"
},
"dependencies": {
"@node-minify/utils": "workspace:*",
"fast-glob": "^3.3.2",
"mkdirp": "3.0.1"
},
"devDependencies": {
"@node-minify/types": "workspace:*",
"@types/mkdirp": "^2.0.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