
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
fluent-transpiler
Advanced tools
Transpile Fluent (ftl) files into optimized, tree-shakable, JavaScript EcmaScript Modules (esm).
Transpile Fluent (ftl) files into optimized, tree-shakable, JavaScript EcmaScript Modules (esm).
npm i -D fluent-transpiler
Usage: ftl [options] <input>
Compile Fluent (.ftl) files to JavaScript (.js or .mjs)
Arguments:
input Path to the Fluent file to compile
Options:
--locale <locale...> What locale(s) to be used. Multiple can be set to allow for fallback. i.e. en-CA
--comments Include comments in output file.
--variable-notation <variableNotation> What variable notation to use with exports (choices: "camelCase", "pascalCase", "constantCase",
"snakeCase", default: "camelCase")
--disable-minify If disabled, all exported messages will have the same interface `(params) => ({value, attributes})`.
--use-isolating Wrap placeable with \u2068 and \u2069.
-o, --output <output> Path to store the resulting JavaScript file. Will be in ESM.
-h, --help display help for command
Option | Description |
---|---|
locale | What locale(s) to be used. Multiple can be set to allow for fallback. i.e. en-CA |
comments | Include comments in output file. Default: true |
disableMinify | If disabled, all exported messages will have the same interface (params) => ({value, attributes}) . Default: each exported message could be a different type based on what is needed to generate the message (string , object , () => '' , () => ({}) ) |
errorOnJunk | Throw error when Junk is parsed. Default: true |
variableNotation | What variable notation to use with exports. Default: camelCase |
useIsolating | Wrap placeable with \u2068 and \u2069. Default: false |
exportDefault | Allows the overwriting of the export default to allow for custom uses. Default: See code |
import { readFile, writeFile } from 'node:fs/promises'
import fluentTranspiler from 'fluent-transpiler'
const ftl = await readFile('./path/to/en.ftl', { encoding: 'utf8' })
const js = fluentTranspiler(ftl, { locale: 'en-CA' })
await writeFile('./path/to/en.mjs', js, 'utf8')
FAQs
Transpile Fluent (ftl) files into optimized, tree-shakable, JavaScript EcmaScript Modules (esm).
The npm package fluent-transpiler receives a total of 24,014 weekly downloads. As such, fluent-transpiler popularity was classified as popular.
We found that fluent-transpiler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.