Huge News!Announcing our $40M Series B led by Abstract Ventures.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.5 to 1.0.6

2

dist-cjs/bin/argv.js

@@ -26,2 +26,4 @@ "use strict";

makeArray('--type');
makeArray('--exclude');
makeArray('--include');
exports.default = args;

13

dist-cjs/bin/main.js

@@ -5,13 +5,8 @@ "use strict";

};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
const argv_js_1 = __importDefault(require("./argv.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 details = (0, getFilesInfo_js_1.default)(targetDir, {
const index_js_1 = __importDefault(require("../index.js"));
const { overview, details } = (0, index_js_1.default)(argv_js_1.default._[0], {
exclude: argv_js_1.default['--exclude'],

@@ -21,4 +16,2 @@ include: argv_js_1.default['--include'],

});
const finalResult = (0, getDetails_js_1.default)(details);
const overview = (0, getOverview_js_1.default)(finalResult);
console.log();

@@ -53,5 +46,5 @@ const group = (label, options) => {

head: ['Name', 'Files', 'Lines', 'ACPL', 'Size (bytes)'],
rows: finalResult.map(({ name, lines, size, files, avgCharPerLine }) => {
rows: details.map(({ name, lines, size, files, avgCharPerLine }) => {
return [name, files, lines, avgCharPerLine, size];
}),
});
import { GetFiles } from './scripts/_getFiles.js';
export declare const getFilesInfo: (targetDir?: string | undefined, config?: GetFiles | undefined) => import("./scripts/getFilesInfo.js").FileInfo[];
export declare const getFilesInfo: (dir?: string | undefined, config?: GetFiles | undefined) => import("./scripts/getFilesInfo.js").FileInfo[];
export declare const getDetails: (details: import("./scripts/getFilesInfo.js").FileInfo[]) => import("./scripts/getDetails.js").Details[];
export declare const getOverview: (details: import("./scripts/getDetails.js").Details[]) => any;
declare const _default: (dir?: string, config?: GetFiles) => {
files: import("./scripts/getFilesInfo.js").FileInfo[];
overview: any;

@@ -7,0 +8,0 @@ details: import("./scripts/getDetails.js").Details[];

@@ -18,2 +18,3 @@ "use strict";

return {
files,
overview,

@@ -20,0 +21,0 @@ details,

@@ -9,3 +9,3 @@ import { GetFiles } from './_getFiles.js';

}
declare const _default: (targetDir?: string, config?: GetFiles) => FileInfo[];
declare const _default: (dir?: string, config?: GetFiles) => FileInfo[];
export default _default;

@@ -9,4 +9,4 @@ "use strict";

const _getFiles_js_1 = __importDefault(require("./_getFiles.js"));
exports.default = (targetDir, config) => {
const files = (0, _getFiles_js_1.default)(targetDir, config);
exports.default = (dir, config) => {
const files = (0, _getFiles_js_1.default)(dir, config);
const fileDetails = files.map((filePath) => {

@@ -13,0 +13,0 @@ const extname = path_1.default.extname(filePath).slice(1);

@@ -21,2 +21,4 @@ import arg from 'arg';

makeArray('--type');
makeArray('--exclude');
makeArray('--include');
export default args;

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

var _a;
import argv from './argv.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 details = getFilesInfo(targetDir, {
import getAll from '../index.js';
const { overview, details } = getAll(argv._[0], {
exclude: argv['--exclude'],

@@ -15,4 +10,2 @@ include: argv['--include'],

});
const finalResult = getDetails(details);
const overview = getOverview(finalResult);
console.log();

@@ -47,5 +40,5 @@ const group = (label, options) => {

head: ['Name', 'Files', 'Lines', 'ACPL', 'Size (bytes)'],
rows: finalResult.map(({ name, lines, size, files, avgCharPerLine }) => {
rows: details.map(({ name, lines, size, files, avgCharPerLine }) => {
return [name, files, lines, avgCharPerLine, size];
}),
});
import { GetFiles } from './scripts/_getFiles.js';
export declare const getFilesInfo: (targetDir?: string | undefined, config?: GetFiles | undefined) => import("./scripts/getFilesInfo.js").FileInfo[];
export declare const getFilesInfo: (dir?: string | undefined, config?: GetFiles | undefined) => import("./scripts/getFilesInfo.js").FileInfo[];
export declare const getDetails: (details: import("./scripts/getFilesInfo.js").FileInfo[]) => import("./scripts/getDetails.js").Details[];
export declare const getOverview: (details: import("./scripts/getDetails.js").Details[]) => any;
declare const _default: (dir?: string, config?: GetFiles) => {
files: import("./scripts/getFilesInfo.js").FileInfo[];
overview: any;

@@ -7,0 +8,0 @@ details: import("./scripts/getDetails.js").Details[];

@@ -12,2 +12,3 @@ import _getFilesInfo from './scripts/getFilesInfo.js';

return {
files,
overview,

@@ -14,0 +15,0 @@ details,

@@ -9,3 +9,3 @@ import { GetFiles } from './_getFiles.js';

}
declare const _default: (targetDir?: string, config?: GetFiles) => FileInfo[];
declare const _default: (dir?: string, config?: GetFiles) => FileInfo[];
export default _default;
import fs from 'fs';
import path from 'path';
import getFiles from './_getFiles.js';
export default (targetDir, config) => {
const files = getFiles(targetDir, config);
export default (dir, config) => {
const files = getFiles(dir, config);
const fileDetails = files.map((filePath) => {

@@ -7,0 +7,0 @@ const extname = path.extname(filePath).slice(1);

{
"name": "code-info",
"version": "1.0.5",
"version": "1.0.6",
"description": "code-info",

@@ -5,0 +5,0 @@ "preferGlobal": true,

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