Practical overview
When it fits
Use Func Js when a TON development workflow needs FunC compilation from JavaScript, TypeScript, a WebAssembly-capable browser, or the command line, especially when BOC output or assembly for debugging is needed.
Who it is for
- TON smart-contract developers working with FunC source
- JavaScript and TypeScript developers adding FunC compilation to a project build
- Developers creating browser-based tools that compile FunC using WebAssembly
Documented uses
- Compile FunC target files and their included sources into BOC code-cell output
- Add compilation to a Node.js or browser-based JavaScript/TypeScript workflow
- Produce a BOC file from source files through the CLI
- Inspect generated Fift assembly while debugging compilation
Requirements & limits
The repository identifies the package as open source under the MIT License.
- Browser use requires WebAssembly support; Node.js is also documented.
- Compilation inputs must include targets and every required included FunC source.
- The library supports source maps, arrays, or a synchronous source resolver; the resolver must return source text.
- The package produces compilation artifacts and assembly; the cited documentation does not describe a deployment workflow.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Compile FunC source with the CLI
Produce a BOC file from FunC source files using the documented command-line interface.
Before you start
- Node.js/npm tooling for the documented npx command
- FunC source files, including required included files such as stdlib.fc when used
Steps
Run the command below, substituting the source and output paths for your project.
npx func-js ./stdlib.fc ./wallet.fc --boc ./output.bocUse the command below to review other available output options.
npx func-js -h
Expected outcome
The CLI is instructed to write compiled BOC output to the specified path.
Guide limitations
- The example command documents file-based CLI use; it does not describe deployment or execution of the resulting contract.
Install the library and prepare a compilation call
Add the package to a JavaScript or TypeScript project and provide the source inputs required by its compiler API.
Before you start
- A Node.js or browser environment with WebAssembly support
- Target FunC source and all required included source files
Steps
Install
@ton-community/func-jswithyarn add @ton-community/func-jsor the command below.npm i @ton-community/func-jsImport
compileFuncand call it with target filenames and a source map, or provide sources as an array of filename/content entries.If using a source array, omit
targetsto use its filenames in order; otherwise specify targets explicitly.
Expected outcome
The documented API returns compilation status and, on success, a base64-encoded BOC code cell plus Fift assembly.
Guide limitations
- All target and included source contents must be supplied or resolvable.
- A resolver must be synchronous and return a string; the guide describes setup and inputs, not a tested build or deployment.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 10 October 2026
- Original website title
- ton-community/func-js · Official homepage title · retained in its source language

