mirror of
https://github.com/beijaflor-io/ghcjs-commonjs.git
synced 2024-10-26 19:13:10 +03:00
.. | ||
hs | ||
js | ||
.babelrc | ||
ghcjs-commonjs-pandoc.cabal | ||
index.html | ||
LICENSE | ||
main-comp.min.js.gz | ||
main.min.js | ||
Makefile | ||
node-main.js | ||
out.min.bad.js | ||
out.min.js | ||
package.json | ||
README.md | ||
screenshot.png | ||
Setup.hs | ||
stack.yaml | ||
webpack.config.js |
ghcjs-commonjs-pandoc
GHCJS CommonJS pandoc example.
Building
Running:
npm install
Will install dependencies. To build you can run:
npm run build
Running
The generated code should be executable in Node.js, but only the Node.js build has been tested. Usage is:
- Compile with
stack build
node node-main.js
const ghcjsRequire = require('ghcjs-require');
const Main = ghcjsRequire(module, 'ghcjs-commonjs-pandoc');
Main(({ wrapped }) => {
wrapped.convert('markdown', 'html', '# Hello World')
.then((res) => console.log(res));
});
Build Time
After 50m I managed to get a runnable on browser output from webpack, by increasing the maximum heap size to 8GB.