JavaScript runtime features for CloudFront Functions - Amazon CloudFront
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

JavaScript runtime features for CloudFront Functions

The Amazon CloudFront Functions JavaScript runtime environment is compliant with ECMAScript (ES) version 5.1 and also supports some features of ES versions 6 through 12.

We recommend that you use runtime 2.0 for the most up to date features. Note that runtime 2.0 has the following changes compared to 1.0:

  • Buffer module methods are available.

  • The following non-standard string prototype methods are not available:

    • String.prototype.bytesFrom()

    • String.prototype.fromBytes()

    • String.prototype.fromUTF8()

    • String.prototype.toBytes()

    • String.prototype.toUTF8()

  • The cryptographic module has the following changes:

    • hash.digest() - Return type is changed to Buffer if no encoding is provided

    • hmac.digest() - Return type is changed to Buffer if no encoding is provided

  • Additional new features are noted in JavaScript runtime 2.0 features for CloudFront Functions.