|
- const { default: getNumberName } = require('../packages/core')
- const fs = require('fs')
- const path = require('path')
-
- const main = async () => {
- const ws = fs.createWriteStream(path.resolve(__dirname, 'count-to-one-million.out.csv'))
- ws.write('number,name\n')
- for (let i = 0; i <= 1000000; i++) {
- if (i % 1000 === 0) {
- console.log(i)
- }
- ws.write(i + ',' + getNumberName(i) + '\n')
- }
- ws.close()
- }
-
- void main()
|