Skip to main content

Crate use_ecmascript

Crate use_ecmascript 

Source
Expand description

§use-ecmascript

ECMAScript edition and target primitives for RustUse.

§Experimental

use-ecmascript is experimental while use-js remains below 0.3.0.

§Example

use use_ecmascript::{ES2024, EcmaScriptTarget};

let target: EcmaScriptTarget = "es2024".parse()?;

assert_eq!(target, ES2024);
assert_eq!(target.to_string(), "ES2024");

§Scope

  • ECMAScript target labels from ES5 through ES2024 and ESNext.
  • Lightweight parsing from common target strings.
  • Display and version helpers for build-tool metadata.

§Non-goals

  • JavaScript parsing or execution.
  • Feature tables for every ECMAScript edition.
  • Browser, runtime, or transpiler compatibility data.

§License

Licensed under either Apache-2.0 or MIT.

Structs§

EcmaScriptYear
Calendar year for annual ECMAScript editions.

Enums§

EcmaScriptEdition
ECMAScript edition numbers for commonly named targets.
EcmaScriptParseError
Error returned while parsing ECMAScript labels.
EcmaScriptTarget
Common ECMAScript language target labels.

Constants§

ES5
ES2015
ES2016
ES2017
ES2018
ES2019
ES2020
ES2021
ES2022
ES2023
ES2024
ESNEXT