Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement โ†’
Sign In

@esmj/size

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esmj/size - npm Package Compare versions

Comparing version
0.7.1
to
0.8.0
+10
-0
CHANGELOG.md

@@ -0,1 +1,11 @@

## 0.8.0 (2025-09-12)
* feat: ๐ŸŽธ add new CLI option code which replace exports ([6da8d5c](https://github.com/mjancarik/esmj-size/commit/6da8d5c))
### BREAKING CHANGE
* ๐Ÿงจ The export CLI option was removed.
## <small>0.7.1 (2025-09-12)</small>

@@ -2,0 +12,0 @@

+1
-1
{
"name": "@esmj/size",
"version": "0.7.1",
"version": "0.8.0",
"description": "JavaScript Package Size Cost like bundlephobia or import-cost",

@@ -5,0 +5,0 @@ "keywords": [

@@ -95,3 +95,3 @@ import { jest } from '@jest/globals';

it('should create index file with exported statements for packages', async () => {
it('should create index file with code snippet for packages', async () => {
await module.createIndex({

@@ -101,4 +101,3 @@ TMP: 'folder',

options: {
exports:
'export { useState } from "react", export { useEffect } from "react-dom";',
code: 'export { useState } from "react"; export { useEffect } from "react-dom";console.log(useState,useEffect);',
},

@@ -110,8 +109,7 @@ });

);
expect(writeFile.mock.calls[0][1]).toMatchInlineSnapshot(`
"export { useState } from "react";
export { useEffect } from "react-dom";"
`);
expect(writeFile.mock.calls[0][1]).toMatchInlineSnapshot(
`"export { useState } from "react"; export { useEffect } from "react-dom";console.log(useState,useEffect);"`,
);
});
});
});

@@ -11,9 +11,4 @@ import os from 'node:os';

if (options?.exports) {
indexImports = options.exports
.split(',')
.map((statement) => statement.trim())
.map((statement) =>
statement[statement.length - 1] !== ';' ? `${statement};` : statement,
);
if (options?.code) {
indexImports = [options.code.trim()];
} else {

@@ -20,0 +15,0 @@ indexImports = imports.map((imp) => {

@@ -50,3 +50,3 @@ import path from 'node:path';

.option('--pretty', 'log only pretty print object')
.option('--exports <string>', 'export statements')
.option('--code <string>', 'code snippet')
.option(

@@ -53,0 +53,0 @@ '--bundle',