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) 508 B
const { preparePyodide } = require('../../pyodide.js') const { getPythonTtxFunction } = require('./get-python-ttx-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 getPythonTtxFunction(pyodide) const result = await pythonFunction() const exitCode = Number(result?.toString() ?? 0) process.exit(exitCode) } module.exports = { main }