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

code-info

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

code-info - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

dist-cjs/data/langList.d.ts

49

dist-cjs/bin/main.js

@@ -8,7 +8,10 @@ "use strict";

const argv_js_1 = __importDefault(require("./argv.js"));
const getFileInfo_js_1 = __importDefault(require("../scripts/getFileInfo.js"));
const getFiles_js_1 = __importDefault(require("../scripts/getFiles.js"));
const path_1 = __importDefault(require("path"));
const cli_table_1 = __importDefault(require("cli-table"));
const ansi_colors_1 = __importDefault(require("ansi-colors"));
const getFilesInfo_js_1 = __importDefault(require("../scripts/getFilesInfo.js"));
const getDetails_js_1 = __importDefault(require("../scripts/getDetails.js"));
const getOverview_js_1 = __importDefault(require("../scripts/getOverview.js"));
const targetDir = path_1.default.resolve((_a = argv_js_1.default._[0]) !== null && _a !== void 0 ? _a : '');
const filesList = (0, getFiles_js_1.default)(targetDir, {
const details = (0, getFilesInfo_js_1.default)(targetDir, {
exclude: argv_js_1.default['--exclude'],

@@ -18,8 +21,36 @@ include: argv_js_1.default['--include'],

});
console.log('Files:', filesList.length);
let lineCount = 0;
filesList.forEach((file) => {
const { lines } = (0, getFileInfo_js_1.default)(file);
lineCount += lines.length;
const finalResult = (0, getDetails_js_1.default)(details);
const overview = (0, getOverview_js_1.default)(finalResult);
console.log();
const group = (label, options) => {
console.log('', ansi_colors_1.default.blueBright.bold(label + ':'));
console.log(new cli_table_1.default(Object.assign({ colAligns: ['left', 'middle', 'right', 'right', 'right'] }, options)).toString());
console.log();
};
const logLangStats = (stats) => {
return {
head: ['Name', 'Percentage'],
rows: stats.map(({ name = '', percentage = '' }) => {
return [name, percentage + '%'];
}),
};
};
group('Basic Overview', {
head: ['Files', 'Lines', 'ACPL', 'Size (bytes)'],
rows: [
[
overview.basic.files.toString(),
overview.basic.lines.toString(),
overview.basic.avgCharPerLine.toString(),
overview.basic.size.toString(),
],
],
});
console.log('Lines:', lineCount);
group('Most used languages by code lines', logLangStats(overview.mostUsedBySize));
group('Most used languages by file sizes', logLangStats(overview.mostUsedByLines));
group('Languages details', {
head: ['Name', 'Files', 'Lines', 'ACPL', 'Size (bytes)'],
rows: finalResult.map(({ name, lines, size, files, avgCharPerLine }) => {
return [name, files, lines, avgCharPerLine, size];
}),
});
var _a;
import argv from './argv.js';
import getFileInfo from '../scripts/getFileInfo.js';
import getFiles from '../scripts/getFiles.js';
import path from 'path';
import Table from 'cli-table';
import ac from 'ansi-colors';
import getFilesInfo from '../scripts/getFilesInfo.js';
import getDetails from '../scripts/getDetails.js';
import getOverview from '../scripts/getOverview.js';
const targetDir = path.resolve((_a = argv._[0]) !== null && _a !== void 0 ? _a : '');
const filesList = getFiles(targetDir, {
const details = getFilesInfo(targetDir, {
exclude: argv['--exclude'],

@@ -12,8 +15,36 @@ include: argv['--include'],

});
console.log('Files:', filesList.length);
let lineCount = 0;
filesList.forEach((file) => {
const { lines } = getFileInfo(file);
lineCount += lines.length;
const finalResult = getDetails(details);
const overview = getOverview(finalResult);
console.log();
const group = (label, options) => {
console.log('', ac.blueBright.bold(label + ':'));
console.log(new Table(Object.assign({ colAligns: ['left', 'middle', 'right', 'right', 'right'] }, options)).toString());
console.log();
};
const logLangStats = (stats) => {
return {
head: ['Name', 'Percentage'],
rows: stats.map(({ name = '', percentage = '' }) => {
return [name, percentage + '%'];
}),
};
};
group('Basic Overview', {
head: ['Files', 'Lines', 'ACPL', 'Size (bytes)'],
rows: [
[
overview.basic.files.toString(),
overview.basic.lines.toString(),
overview.basic.avgCharPerLine.toString(),
overview.basic.size.toString(),
],
],
});
console.log('Lines:', lineCount);
group('Most used languages by code lines', logLangStats(overview.mostUsedBySize));
group('Most used languages by file sizes', logLangStats(overview.mostUsedByLines));
group('Languages details', {
head: ['Name', 'Files', 'Lines', 'ACPL', 'Size (bytes)'],
rows: finalResult.map(({ name, lines, size, files, avgCharPerLine }) => {
return [name, files, lines, avgCharPerLine, size];
}),
});

5

package.json
{
"name": "code-info",
"version": "1.0.2",
"version": "1.0.3",
"description": "code-info",

@@ -21,3 +21,5 @@ "preferGlobal": true,

"dependencies": {
"ansi-colors": "^4.1.3",
"arg": "^5.0.2",
"cli-table": "^0.3.11",
"ignore": "^5.2.0",

@@ -28,2 +30,3 @@ "node-ls-files": "latest",

"devDependencies": {
"@types/cli-table": "^0.3.1",
"@types/node": "latest",

@@ -30,0 +33,0 @@ "@types/parse-gitignore": "^1.0.0",

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

# Coming soom :)
# Coming soon :)
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