UNPKG

@web-alchemy/fonttools

Version:

This is the Node.js adapter of [python font tools](https://github.com/fonttools/fonttools) via [Pyodide](https://pyodide.org) without having to install python and its dependencies.

17 lines (15 loc) 526 B
const { preparePyodide } = require('../../pyodide.js') const { getPythonFontToolsFunction } = require('./get-python-fonttools-function.js') async function main() { const pyodide = await preparePyodide({ args: process.argv.slice(1) }) pyodide.FS.mount(pyodide.FS.filesystems.NODEFS, { root: '.' }, '.') const pythonFunction = await getPythonFontToolsFunction(pyodide) const result = await pythonFunction() const exitCode = Number(result?.toString() ?? 0) process.exit(exitCode) } module.exports = { main }