0.0.58 • Published 1 year ago
coffee_plus v0.0.58
iter2file
安装
推荐用 @antfu/ni
ni -D iter2file
使用
#!/usr/bin/env coffee
import TEST from './code.js'
import CoffeeScript from "coffeescript"
import hack from 'coffee_plus'
hack CoffeeScript
for [kind, code] from Object.entries(TEST)
#if kind != 'export'
# continue
console.log """## #{kind}
#{code}`
→
#{CoffeeScript.compile(code, bare:true)}```"""
输出
label
y = 0
:$ x=y*2
:$ if y>2 then x+=y else x-=y
:$
if x > y
x = y/2
else
x = y+9
x += 1
:$ func = => 1
:$ func = ->
1
2
do =>
:out
for i in [1,2,3]
for j in [4,5,6]
console.log i,j
if i > 1
break out
return
→
var func, x, y;
y = 0;
$ : x = y * 2;
$ : y > 2 ? x += y : x -= y;
$ : {
if (x > y) {
x = y / 2;
} else {
x = y + 9;
}
x += 1;
}
$ : (func = () => {
return 1;
});
$ : (func = function() {
1;
return 2;
});
(() => {
var i, j, k, l, len, len1, ref, ref1;
out : {
ref = [1, 2, 3];
for (k = 0, len = ref.length; k < len; k++) {
i = ref[k];
ref1 = [4, 5, 6];
for (l = 0, len1 = ref1.length; l < len1; l++) {
j = ref1[l];
console.log(i, j);
if (i > 1) {
break out;
}
}
}
}
})();
var
do =>
+ a,b
→
(() => {
var a, b;
})();
export
< x
< x = 1
→
export var x;
export var x = 1;
import
> fs1 path0
console.log 1
> fs/promises
> fs/promises:fs
> fs2
fs:
path1
test.css
>
path3 > join dirname1
path4:@ > join1
path5:p5 > join:J1 dirname2
fs3 path5:p6 > join:J dirname
→
import fs1 from 'fs1';
import path0 from 'path0';
console.log(1);
import promises from 'fs/promises';
import fs from 'fs/promises';
import fs2 from 'fs2';
import 'fs';
import path1 from 'path1';
import 'test.css';
import {
join,
dirname1
} from 'path3';
import path4 from 'path4';
import {
join1
} from 'path4';
import p5 from 'path5';
import {
join as J1,
dirname2
} from 'path5';
import fs3 from 'fs3';
import p6 from 'path5';
import {
join as J,
dirname
} from 'path5';
0.0.56
1 year ago
0.0.57
1 year ago
0.0.58
1 year ago
0.0.47
1 year ago
0.0.51
1 year ago
0.0.52
1 year ago
0.0.53
1 year ago
0.0.54
1 year ago
0.0.55
1 year ago
0.0.50
1 year ago
0.0.48
1 year ago
0.0.49
1 year ago
0.0.44
1 year ago
0.0.45
1 year ago
0.0.46
1 year ago
0.0.41
2 years ago
0.0.42
2 years ago
0.0.43
2 years ago
0.0.39
2 years ago
0.0.38
2 years ago
0.0.37
2 years ago
0.0.35
2 years ago
0.0.34
2 years ago
0.0.33
2 years ago
0.0.32
2 years ago
0.0.31
2 years ago
0.0.30
2 years ago
0.0.29
2 years ago
0.0.28
2 years ago
0.0.27
2 years ago
0.0.26
2 years ago
0.0.25
2 years ago
0.0.23
2 years ago
0.0.22
2 years ago
0.0.21
2 years ago
0.0.20
2 years ago
0.0.19
2 years ago
0.0.18
2 years ago
0.0.17
2 years ago
0.0.16
2 years ago
0.0.15
2 years ago
0.0.14
2 years ago
0.0.13
2 years ago
0.0.12
2 years ago
0.0.11
2 years ago
0.0.10
2 years ago
0.0.9
2 years ago