Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-literals

Package Overview
Dependencies
54
Maintainers
4
Versions
64
Alerts
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

@babel/plugin-transform-literals

Compile ES2015 unicode string and number literals to ES5

    7.23.3latest
    GitHub
    npm

Version published
Maintainers
4
Weekly downloads
24,025,356
increased by3.93%

Weekly downloads

Package description

What is @babel/plugin-transform-literals?

The @babel/plugin-transform-literals package is a plugin for Babel, a JavaScript compiler, that transforms modern JavaScript literal syntax into a form compatible with older JavaScript engines. This includes transforming template literals, binary literals, octal literals, and Unicode string literals into strings and numbers that can be understood by environments that do not support these features natively.

What are @babel/plugin-transform-literals's main functionalities?

Template Literals Transformation

Converts template literals into string concatenation to ensure compatibility with older JavaScript engines.

`Hello, ${name}!` -> 'Hello, ' + name + '!'

Binary Literals Transformation

Transforms binary literals into their decimal number equivalents.

0b101001 -> 41

Octal Literals Transformation

Converts octal literals into their decimal number equivalents.

0o755 -> 493

Unicode String Literals Transformation

Transforms Unicode string literals into escaped sequences compatible with older JavaScript engines.

'\u{1F680}' -> '\uD83D\uDE80'

Other packages similar to @babel/plugin-transform-literals

Changelog

Source

v7.23.3 (2023-11-09)

:bug: Bug Fix
  • babel-plugin-transform-typescript
    • #16071 Strip type-only TS namespaces (@colinaaa)
  • babel-generator
  • babel-compat-data, babel-plugin-bugfix-v8-static-class-fields-redefine-readonly, babel-preset-env
  • babel-plugin-transform-object-super
  • babel-helper-module-transforms, babel-plugin-transform-modules-amd, babel-plugin-transform-modules-commonjs, babel-plugin-transform-modules-umd
:memo: Documentation
  • #16044 docs: Update links in @babel/eslint-parser README (@aryehb)
:house: Internal
  • babel-core, babel-preset-env
:running_woman: Performance
:microscope: Output optimization
  • babel-plugin-transform-computed-properties

Readme

Source

@babel/plugin-transform-literals

Compile ES2015 unicode string and number literals to ES5

See our website @babel/plugin-transform-literals for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-transform-literals

or using yarn:

yarn add @babel/plugin-transform-literals --dev

Keywords

FAQs

Last updated on 09 Nov 2023

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the 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