linguist-js
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -7,3 +7,2 @@ "use strict"; | ||
const VERSION = require('../package.json').version; | ||
const path_1 = __importDefault(require("path")); | ||
const commander_1 = require("commander"); | ||
@@ -52,8 +51,2 @@ const index_1 = __importDefault(require("./index")); | ||
const { files, languages, unknown } = await (0, index_1.default)(root, args); | ||
// Make file paths relative | ||
for (const [file, lang] of Object.entries(files.results)) { | ||
const relFile = file.replace(path_1.default.resolve().replace(/\\/g, '/'), '.'); | ||
delete files.results[file]; | ||
files.results[relFile] = lang; | ||
} | ||
// Print output | ||
@@ -63,3 +56,3 @@ if (!args.json) { | ||
const totalBytes = languages.bytes; | ||
console.log(`Analysed ${files.bytes} B from ${files.count} files with linguist-js`); | ||
console.log(`Analysed ${files.bytes.toLocaleString()} B from ${files.count} files with linguist-js`); | ||
console.log(`\n Language analysis results:`); | ||
@@ -71,3 +64,3 @@ let i = 0; | ||
lang: lang.padEnd(24, ' '), | ||
percent: (bytes / totalBytes * 100).toFixed(2).padStart(5, ' '), | ||
percent: (bytes / (totalBytes || 1) * 100).toFixed(2).padStart(5, ' '), | ||
bytes: bytes.toLocaleString().padStart(10, ' '), | ||
@@ -74,0 +67,0 @@ }; |
{ | ||
"name": "linguist-js", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Analyse languages used in a folder. Powered by GitHub Linguist, although it doesn't need to be installed.", | ||
@@ -9,2 +9,5 @@ "main": "dist/index.js", | ||
}, | ||
"engines": { | ||
"node": ">=12" | ||
}, | ||
"scripts": { | ||
@@ -11,0 +14,0 @@ "prepublish": "tsc", |
@@ -34,3 +34,3 @@ [![Latest version](https://img.shields.io/github/v/release/Nixinova/Linguist?label=latest%20version&style=flat-square)](https://github.com/Nixinova/Linguist/releases) | ||
``` | ||
. | ||
/ | ||
| src | ||
@@ -51,6 +51,6 @@ | | cli.js 1kB | ||
"results": { | ||
"src/index.ts": "TypeScript", | ||
"src/cli.js": "JavaScript", | ||
"readme.md": "Markdown", | ||
"no-lang": null, | ||
"/src/index.ts": "TypeScript", | ||
"/src/cli.js": "JavaScript", | ||
"/readme.md": "Markdown", | ||
"/no-lang": null, | ||
} | ||
@@ -78,2 +78,4 @@ }, | ||
Note that file paths in the output use only forward slashes as delimiters, even on Windows. | ||
## API | ||
@@ -80,0 +82,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
163
32435
515