Socket
Socket
Sign inDemoInstall

fluent-syntax

Package Overview
Dependencies
0
Maintainers
3
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fluent-syntax

AST and parser for Fluent


Version published
Weekly downloads
20K
decreased by-17.4%
Maintainers
3
Install size
165 kB
Created
Weekly downloads
 

Readme

Source

fluent-syntax

fluent-syntax is a parser for Fluent translation files, FTL. Project Fluent is a localization framework designed to unleash the expressive power of the natural language.

Installation

fluent-syntax can be used both on the client-side and the server-side. You can install it from the npm registry or use it as a standalone script (as the FluentSyntax global).

npm install fluent-syntax

How to use

import { parse, Resource } from 'fluent-syntax';

const res = parse(`
brand-name = Foo 3000
welcome    = Welcome, { $name }, to { brand-name }!
`);

assert(res instanceof Resource);

The API reference is available at http://projectfluent.org/fluent.js/fluent-syntax.

Compatibility

For legacy browsers, the compat build has been transpiled using Babel's env preset:

import 'fluent-syntax/compat';

Learn more

Find out more about Project Fluent at projectfluent.org, including documentation of the Fluent file format (FTL), links to other packages and implementations, and information about how to get involved.

Keywords

FAQs

Last updated on 25 Jul 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc