-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from alexeyraspopov/feature/ForceCJS
The world is not ready for esm yet
- Loading branch information
Showing
17 changed files
with
446 additions
and
502 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
[*.{js,d.ts}] | ||
charset = utf-8 | ||
indent_style = tab | ||
indent_size = 2 | ||
trim_trailing_whitespace = true | ||
|
||
[package.json,*.yaml] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
#!/usr/bin/env node | ||
|
||
import { execSync } from "child_process"; | ||
let { execSync } = require("child_process"); | ||
|
||
const RUNS = 50; | ||
let RUNS = 50; | ||
|
||
const results = {}; | ||
let results = {}; | ||
|
||
for (let i = 0; i < RUNS; i++) { | ||
const output = execSync("node ./benchmarks/loading-runner.cjs").toString(); | ||
output | ||
.trim() | ||
.split("\n") | ||
.forEach((line) => { | ||
let [name, result] = line.split(" "); | ||
results[name] = (results[name] || 0) + parseFloat(result); | ||
}); | ||
let output = execSync("node ./benchmarks/loading-runner.js").toString(); | ||
output | ||
.trim() | ||
.split("\n") | ||
.forEach((line) => { | ||
let [name, result] = line.split(" "); | ||
results[name] = (results[name] || 0) + parseFloat(result); | ||
}); | ||
} | ||
|
||
for (const name in results) { | ||
const prefix = name === "picocolors" ? "+ " : " "; | ||
const title = name.padEnd("kleur/colors ".length); | ||
const time = (Math.round((1000 * results[name]) / RUNS) / 1000) | ||
.toString() | ||
.replace(/\.\d$/, "$&00") | ||
.replace(/\.\d\d$/, "$&0"); | ||
process.stdout.write(prefix + title + "\x1B[1m" + time.padStart(6) + "\x1B[22m ms\n"); | ||
for (let name in results) { | ||
let prefix = name === "picocolors" ? "+ " : " "; | ||
let title = name.padEnd("kleur/colors ".length); | ||
let time = (Math.round((1000 * results[name]) / RUNS) / 1000) | ||
.toString() | ||
.replace(/\.\d$/, "$&00") | ||
.replace(/\.\d\d$/, "$&0"); | ||
process.stdout.write(prefix + title + "\x1B[1m" + time.padStart(6) + "\x1B[22m ms\n"); | ||
} |
Oops, something went wrong.