Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-template-literals

Package Overview
Dependencies
Maintainers
5
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-template-literals - npm Package Compare versions

Comparing version 7.0.0-beta.49 to 7.0.0-beta.50

10

package.json
{
"name": "@babel/plugin-transform-template-literals",
"version": "7.0.0-beta.49",
"version": "7.0.0-beta.50",
"description": "Compile ES2015 template literals to ES5",

@@ -9,4 +9,4 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-template-literals",

"dependencies": {
"@babel/helper-annotate-as-pure": "7.0.0-beta.49",
"@babel/helper-plugin-utils": "7.0.0-beta.49"
"@babel/helper-annotate-as-pure": "7.0.0-beta.50",
"@babel/helper-plugin-utils": "7.0.0-beta.50"
},

@@ -20,5 +20,5 @@ "keywords": [

"devDependencies": {
"@babel/core": "7.0.0-beta.49",
"@babel/helper-plugin-test-runner": "7.0.0-beta.49"
"@babel/core": "7.0.0-beta.50",
"@babel/helper-plugin-test-runner": "7.0.0-beta.50"
}
}

@@ -5,82 +5,16 @@ # @babel/plugin-transform-template-literals

## Example
See our website [@babel/plugin-transform-template-literals](https://new.babeljs.io/docs/en/next/babel-plugin-transform-template-literals.html) for more information.
**In**
## Install
```javascript
`foo${bar}`;
```
Using npm:
**Out**
```javascript
"foo".concat(bar);
```
## Installation
```sh
npm install --save-dev @babel/plugin-transform-template-literals
npm install --save @babel/plugin-transform-template-literals
```
## Usage
or using yarn:
### Via `.babelrc` (Recommended)
**.babelrc**
Without options:
```json
{
"plugins": ["@babel/plugin-transform-template-literals"]
}
```
With options:
```json
{
"plugins": [
["@babel/plugin-transform-template-literals", {
"loose": true
}]
]
}
```
### Via CLI
```sh
babel --plugins @babel/plugin-transform-template-literals script.js
yarn add --save @babel/plugin-transform-template-literals
```
### Via Node API
```javascript
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-transform-template-literals"]
});
```
## Options
### `loose`
`boolean`, defaults to `false`.
When `true`, tagged template literal objects aren't frozen. All template literal expressions and quasis are combined with the `+` operator instead of with `String.prototype.concat`.
When `false` or not set, all template literal expressions and quasis are combined with `String.prototype.concat`. It will handle cases with `Symbol.toPrimitive` correctly and throw correctly if template literal expression is a `Symbol()`. See [babel/babel#5791](https://github.com/babel/babel/pull/5791).
**In**
```javascript
`foo${bar}`;
```
**Out**
```javascript
"foo" + bar;
```
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc