Skip to content

Instantly share code, notes, and snippets.

@VacantThinker
Created December 29, 2023 17:50
Show Gist options
  • Select an option

  • Save VacantThinker/11103672a059b151d45e115dc3f40563 to your computer and use it in GitHub Desktop.

Select an option

Save VacantThinker/11103672a059b151d45e115dc3f40563 to your computer and use it in GitHub Desktop.
use cmd create a blank file

https://cmdwindows.com/create-file


type nul > filename.txt
const {execSync} = require("node:child_process");
// todo rmdir dist && mkdir dist

let a = 9
let b = 30

for (let i = a; i <= b; i++) {
  let filename = null
  if (i < 10) {
    filename = `0${i}`
  }else {
    filename = `${i}`
  }

  let cmd = `type nul > ${filename}.js`
  execSync(cmd)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment