A command-line formatter for FUSE language source code.
npm install -g fuse-formatterOr install locally in your project:
npm install fuse-formatterfuse-formatter [options] <input>input- Input file to format (use-to read from stdin)
-o, --output <file>- Output destination (use-for stdout, default: stdout)-i, --indent <number>- Number of spaces for indentation (default: 2)-s, --semi- Require semicolons-h, --help- Show help message
Format a file and output to stdout:
fuse-formatter input.fuseFormat with custom indentation (4 spaces):
fuse-formatter input.fuse -i 4Format with semicolons required:
fuse-formatter input.fuse -sFormat and save to a file:
fuse-formatter input.fuse -o output.fuseFormat from stdin:
cat input.fuse | fuse-formatter -Combine multiple options:
fuse-formatter input.fuse -i 4 -s -o formatted.fuseYou can also use the formatter programmatically in your Node.js projects:
const { format } = require('fuse-formatter');
const sourceCode = '/* your FUSE code here */';
// Format with default options (indent: 2, semi: false)
const formatted = format(sourceCode);
// Format with custom options
const formattedWithOptions = format(sourceCode, {
indent: 4, // Use 4 spaces for indentation
semi: true // Require semicolons
});
console.log(formattedWithOptions);Formats FUSE source code.
Parameters:
input(string) - Source code to formatoptions(object) - Optional formatting optionsindent(number) - Number of spaces for indentation (default: 2)semi(boolean) - Whether to require semicolons (default: false)
Returns: (string) - Formatted source code
MPL-2.0
- GitHub: scratch-fuse/fuse-formatter
- Issues: Report bugs
FurryR