Buckets:
| import picocolors from 'picocolors' | |
| import { Interface } from '../index.js' | |
| import { formatUnit } from '../units.js' | |
| import { formatVariant } from '../utils.js' | |
| const { bgCyan, bold, magenta, red, underline } = picocolors | |
| export default function createInterface(): Interface { | |
| const iface: Interface = { | |
| start: async (scenario, props) => { | |
| console.log( | |
| bold(underline(`Running ${formatVariant(scenario, props)}...`)) | |
| ) | |
| }, | |
| measurement: async (scenario, props, name, value, unit, relativeTo) => { | |
| console.log( | |
| bgCyan( | |
| bold( | |
| magenta( | |
| `${formatVariant(scenario, props)}: ${name} = ${formatUnit( | |
| value, | |
| unit | |
| )}${relativeTo ? ` (from ${relativeTo})` : ''}` | |
| ) | |
| ) | |
| ) | |
| ) | |
| }, | |
| error: async (scenario, props, error) => { | |
| console.log( | |
| bold( | |
| red( | |
| `${formatVariant(scenario, props)}: ${ | |
| (error && (error as any).stack) || error | |
| }` | |
| ) | |
| ) | |
| ) | |
| }, | |
| } | |
| return iface | |
| } | |
Xet Storage Details
- Size:
- 1.11 kB
- Xet hash:
- 019ac9cc3372a43f6f5cec9eb066ef46c00e4dd116c05df43bd4dfb032f7c564
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.