1.0.17 • Published 3 years ago
nv-cli-loop v1.0.17
nv-cli-loop
- nv-cli-loop
- cli tool, quickly generate for/while blocks
install
- npm install nv-cli-loop -g
usage
nv-cli-loop# node loop-cli.js -h
Usage: nv_loop [options]
Options:
-d, --depth nest depth, default 3
-i, --indent indent,default 1
-f, --for for loop
-n, --forin for in loop
-o, --forof for of loop
-a, --awaitof for await of loop
-w, --while while loop
-h, --help usage
nv-cli-loop#
for
nv-cli-loop# node loop-cli.js -f -d 4
let ilngth=;
let jlngth=;
let klngth=;
let l3lngth=;
\\\\
for(let i=0;i<ilngth;i++){
for(let j=0;j<jlngth;j++){
for(let k=0;k<klngth;k++){
for(let l3=0;l3<l3lngth;l3++){
}
}
}
}
nv-cli-loop#
while
nv-cli-loop# node loop-cli.js -w -d 4
let ilngth=;
let jlngth=;
let klngth=;
let l3lngth=;
\\\\
let i=0;
while(i<ilngth){
let j=0;
while(j<jlngth){
let k=0;
while(k<klngth){
let l3=0;
while(l3<l3lngth){
l3=l3+1
}
k=k+1
}
j=j+1
}
i=i+1
}
nv-cli-loop#
forin
nv-cli-loop# node loop-cli.js -n -d 4
let d=;
for(let i in d ){
for(let j in i ){
for(let k in j ){
for(let l3 in k ){
}
}
}
}
nv-cli-loop#
forof
nv-cli-loop# node loop-cli.js -o -d 4
let o=;
for(let i of o ){
for(let j of i ){
for(let k of j ){
for(let l3 of k ){
}
}
}
}
nv-cli-loop#
for await of
nv-cli-loop# node loop-cli.js -a -d 5
let o=;
for await(let i of o ){
for await(let j of i ){
for await(let k of j ){
for await(let l3 of k ){
for await(let l4 of l3 ){
}
}
}
}
}
nv-cli-loop#
LICENSE
- ISC
1.0.17
3 years ago