Registry / devops / tolkfmt-test-dev

tolkfmt-test-dev

JSON →
library0.0.27jsnpmunverified

Code formatter for the Tolk programming language, used in the TON blockchain ecosystem. Version 0.0.27 is the latest stable release, released under an active development cadence. It provides CLI-based formatting with options for --write, --check, and range formatting, making it suitable for CI/CD pipelines and editor integration. Ships TypeScript types. Differentiates by targeting Tolk specifically, with zero-config defaults and robust range formatting support for LSP integration.

npm install tolkfmt-test-dev
INSTALL
IMPORT
SIG · TOLKFMT-TEST-DEV
T
tolkfmt-test-dev
devopsjavascriptv0.0.27
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tolkfmt CLI
tolkfmt file.tolk
npx tolkfmt file.tolk
Install globally or use npx. The package is a CLI tool, not a library.
formatWithOptions
import { formatWithOptions } from 'tolkfmt'
const { formatWithOptions } = require('tolkfmt')
ESM-only package. Use dynamic import() if needed in CJS.
format
import { format } from 'tolkfmt'
import format from 'tolkfmt'
Named export, not default. Since v0.0.20.

Demonstrates programmatic usage of tolkfmt API to format a Tolk file from Node.js.

import { formatWithOptions } from 'tolkfmt'; import { readFileSync, writeFileSync } from 'fs'; const source = readFileSync('contract.tolk', 'utf8'); try { const formatted = formatWithOptions(source, { tabSize: 2 }); writeFileSync('contract.tolk', formatted, 'utf8'); console.log('Formatted successfully'); } catch (err) { console.error('Formatting error:', err.message); }
Debug
Known issues
breakingPackage renamed from 'tolkfmt' to 'tolkfmt-test-dev' for testing purposes. Do not use in production.
fix
Use the stable package 'tolkfmt' when available.
affects: >=0.0.1
gotchaRange options use zero-based line and character indices, unlike many editors.
fix
Adjust indices to start from 0; use editor LSP extensions if available.
affects: >=0.0.11
gotchaThe --check flag exits with code 1 if formatting issues are found, breaking CI if not handled.
fix
Use --write in CI or handle exit code appropriately.
affects: >=0.0.15
deprecatedSupport for Node.js <18 dropped in v0.0.20.
fix
Upgrade to Node.js 18+.
affects: >=0.0.20
Errors
Common errors & fixes
Error: Cannot find module 'tolkfmt'
Package not installed globally or locally.
fix
Run `npm i -g tolkfmt-test-dev` or use `npx tolkfmt-test-dev`.
TypeError: format is not a function
Using default import instead of named import.
fix
Use `import { format } from 'tolkfmt'`.
SyntaxError: ... unexpected token
Invalid Tolk syntax; the formatter cannot parse the file.
fix
Fix syntax errors in your .tolk file before formatting.
Upgrade
Version history
0.0.27latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
tolkfmt-test-dev — npm install tolkfmt-test-dev · libregistry