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

collect-react-stats

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

collect-react-stats - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

18

bin/collect-react-stats.js

@@ -86,8 +86,12 @@ #!/usr/bin/env node

/** @type {Array<string | number>[]} */
const tableData = [["Type", "Total"]];
const tableData = [["Type", "Total", "Percent"]];
for (let row of rows) {
tableData.push([row, stats.data[row]]);
tableData.push([
row,
stats.data[row],
((stats.data[row] / stats.total) * 100).toFixed(2) + "%",
]);
}
tableData.push(["Total", stats.total]);
tableData.push(["Total", stats.total, "100%"]);

@@ -214,7 +218,11 @@ return table(tableData, { border: getBorderCharacters("norc") });

console.log("Top 20 props passed to DOM VNodes:");
console.log(">1% props passed to DOM VNodes (min: 20, max 30):");
const domPropsData = result.summary.domProps.data;
const domPropsTotal = result.summary.domProps.total;
const keys = Object.keys(domPropsData)
.sort((key1, key2) => domPropsData[key2] - domPropsData[key1]) // reverse sort largest to smallest
.slice(0, 20);
.slice(0, 30)
.filter((key, i) => {
return i < 20 || domPropsData[key] / domPropsTotal >= 0.01;
});
console.log(buildStatsTableFromRow(result.summary.domProps, keys));

@@ -221,0 +229,0 @@

{
"name": "collect-react-stats",
"type": "module",
"version": "0.0.3",
"version": "0.0.4",
"description": "CLI to collect stats about React usage on a website",

@@ -6,0 +6,0 @@ "main": "src/index.js",

@@ -0,0 +0,0 @@ # collect-react-stats

Sorry, the diff of this file is not supported yet

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