2.0.0 • Published 4 years ago
transpiler-jsh v2.0.0
JSH Transpiler
What is JSH
JSH is a language that allowed writing html directly in JS, different from JSX
JSH example code
test.jsh
import fs from "fs";
fs.writeFileSync("test.html", (<div>Hello world</div>));Write this in init.js
import { run } from "transpiler-jsh";
run("test.jsh", "init.js");run node init.js
Content in init.js:
import fs from "fs";
fs.writeFileSync("test.html", `<div>Hello world</div>`);Syntax
- HTML code in JSH will be rendered to template string
- Use
${variable_name}to use variable's value in string - HTML code must be surrounded with ()
console.log(
(
<div></div>
)); // Won't work
console.log((<div></div>)); // Work
console.log((<div>
Hello
</div>)); // WorkCLI usage
npx transpile your_file_path.jsh your_file_path.js # Transpile content of 'your_file_path.jsh' to your 'your_file_path.js'
npx nodeh your_file_path.jsh # Run JSH file2.0.0
4 years ago
0.0.9
4 years ago
0.0.8
4 years ago
0.0.7
4 years ago
0.0.6
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago