1filecompiler 中文文档教程
1 File Compiler
What is this?
这是将 html、css 和 javascript 编译成一个 html 文件的有用工具。 我找不到这样的东西所以我自己做了。
Why?
我创建这个是因为我希望用户能够打开一个 html 文件并查看网站,而无需从 Internet 或其他本地文件加载内容。
CAUTION
这可能有很多错误,所以如果你要在生产中使用它,请注意 提示:不要
它也根本不能很好地管理错误 提示:不要 strong>
Installation
npm i -g 1filecompiler
用于 CLI
npm i --save-dev 1filecompiler
用于 API
CLI
CLI 很简单
npx 1fc input.html output.html
API
const { compile } = require("1fc"); // Import module
let compiledHTML = compile("./input.html"); // Read file and then compile it
console.log(compiledHTML); // Log the compiled output to console
1 File Compiler
What is this?
This is a useful tool for compiling html, css and javascript into one html file. I could not find something like this so I made it myself.
Why?
I created this because I wanted a user to be able to open one html file and view a website without loading content from the internet or other local files.
CAUTION
This probably has a lot of bugs so be aware if your gonna use this in production tip: don't
It also does not manage errors well at all
Installation
npm i -g 1filecompiler
for CLI
npm i --save-dev 1filecompiler
for API
CLI
The CLI is easy
npx 1fc input.html output.html
API
const { compile } = require("1fc"); // Import module
let compiledHTML = compile("./input.html"); // Read file and then compile it
console.log(compiledHTML); // Log the compiled output to console