Skip to content

Commit

Permalink
Move to console colors from Node.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Apr 7, 2024
1 parent df9bb34 commit 596a8b2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -60,7 +60,6 @@
"c8": "^9.1.0",
"clean-publish": "^4.4.0",
"eslint": "^8.57.0",
"picocolors": "^1.0.0",
"rndm": "^1.2.0",
"secure-random-string": "^1.1.3",
"shortid": "^2.2.16",
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions test/benchmark.js
Expand Up @@ -4,14 +4,14 @@ import { v4 as lukeed4 } from '@lukeed/uuid'
import { v4 as napiV4 } from '@napi-rs/uuid'
import benchmark from 'benchmark'
import crypto from 'node:crypto'
import pico from 'picocolors'
import rndm from 'rndm'
import srs from 'secure-random-string'
import shortid from 'shortid'
import { uid } from 'uid'
import uidSafe from 'uid-safe'
import { uid as uidSecure } from 'uid/secure'
import { v4 as uuid4 } from 'uuid'
import { styleText } from 'node:util'

import { nanoid as browser } from '../index.browser.js'
import { customAlphabet, nanoid } from '../index.js'
Expand Down Expand Up @@ -76,6 +76,8 @@ suite
if (event.target.name === 'uid') {
name = '\nNon-secure:\n' + name
}
process.stdout.write(`${name}${pico.bold(hz)}${pico.dim(' ops/sec')}\n`)
process.stdout.write(
`${name}${styleText('bold', hz)}${styleText('dim', ' ops/sec')}\n`
)
})
.run()

0 comments on commit 596a8b2

Please sign in to comment.