Socket
Socket
Sign inDemoInstall

@babel/standalone

Package Overview
Dependencies
Maintainers
5
Versions
292
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/standalone - npm Package Compare versions

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

test/babel.js

174

package.json
{
"name": "@babel/standalone",
"version": "7.0.0-beta.49",
"version": "7.0.0-beta.50",
"description": "Standalone build of Babel for use in non-Node.js environments.",

@@ -12,88 +12,88 @@ "main": "babel.js",

"devDependencies": {
"@babel/core": "7.0.0-beta.49",
"@babel/plugin-external-helpers": "7.0.0-beta.49",
"@babel/plugin-proposal-async-generator-functions": "7.0.0-beta.49",
"@babel/plugin-proposal-class-properties": "7.0.0-beta.49",
"@babel/plugin-proposal-decorators": "7.0.0-beta.49",
"@babel/plugin-proposal-do-expressions": "7.0.0-beta.49",
"@babel/plugin-proposal-export-default-from": "7.0.0-beta.49",
"@babel/plugin-proposal-export-namespace-from": "7.0.0-beta.49",
"@babel/plugin-proposal-function-bind": "7.0.0-beta.49",
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.49",
"@babel/plugin-proposal-optional-catch-binding": "7.0.0-beta.49",
"@babel/plugin-proposal-pipeline-operator": "7.0.0-beta.49",
"@babel/plugin-proposal-unicode-property-regex": "7.0.0-beta.49",
"@babel/plugin-syntax-async-generators": "7.0.0-beta.49",
"@babel/plugin-syntax-class-properties": "7.0.0-beta.49",
"@babel/plugin-syntax-decorators": "7.0.0-beta.49",
"@babel/plugin-syntax-do-expressions": "7.0.0-beta.49",
"@babel/plugin-syntax-dynamic-import": "7.0.0-beta.49",
"@babel/plugin-syntax-export-default-from": "7.0.0-beta.49",
"@babel/plugin-syntax-export-namespace-from": "7.0.0-beta.49",
"@babel/plugin-syntax-flow": "7.0.0-beta.49",
"@babel/plugin-syntax-function-bind": "7.0.0-beta.49",
"@babel/plugin-syntax-function-sent": "7.0.0-beta.49",
"@babel/plugin-syntax-import-meta": "7.0.0-beta.49",
"@babel/plugin-syntax-jsx": "7.0.0-beta.49",
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.49",
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.49",
"@babel/plugin-syntax-pipeline-operator": "7.0.0-beta.49",
"@babel/plugin-syntax-typescript": "7.0.0-beta.49",
"@babel/plugin-transform-arrow-functions": "7.0.0-beta.49",
"@babel/plugin-transform-async-to-generator": "7.0.0-beta.49",
"@babel/plugin-transform-block-scoped-functions": "7.0.0-beta.49",
"@babel/plugin-transform-block-scoping": "7.0.0-beta.49",
"@babel/plugin-transform-classes": "7.0.0-beta.49",
"@babel/plugin-transform-computed-properties": "7.0.0-beta.49",
"@babel/plugin-transform-destructuring": "7.0.0-beta.49",
"@babel/plugin-transform-dotall-regex": "7.0.0-beta.49",
"@babel/plugin-transform-duplicate-keys": "7.0.0-beta.49",
"@babel/plugin-transform-exponentiation-operator": "7.0.0-beta.49",
"@babel/plugin-transform-flow-comments": "7.0.0-beta.49",
"@babel/plugin-transform-flow-strip-types": "7.0.0-beta.49",
"@babel/plugin-transform-for-of": "7.0.0-beta.49",
"@babel/plugin-transform-function-name": "7.0.0-beta.49",
"@babel/plugin-transform-instanceof": "7.0.0-beta.49",
"@babel/plugin-transform-jscript": "7.0.0-beta.49",
"@babel/plugin-transform-literals": "7.0.0-beta.49",
"@babel/plugin-transform-member-expression-literals": "7.0.0-beta.49",
"@babel/plugin-transform-modules-amd": "7.0.0-beta.49",
"@babel/plugin-transform-modules-commonjs": "7.0.0-beta.49",
"@babel/plugin-transform-modules-systemjs": "7.0.0-beta.49",
"@babel/plugin-transform-modules-umd": "7.0.0-beta.49",
"@babel/plugin-transform-new-target": "7.0.0-beta.49",
"@babel/plugin-transform-object-assign": "7.0.0-beta.49",
"@babel/plugin-transform-object-set-prototype-of-to-assign": "7.0.0-beta.49",
"@babel/plugin-transform-object-super": "7.0.0-beta.49",
"@babel/plugin-transform-parameters": "7.0.0-beta.49",
"@babel/plugin-transform-property-literals": "7.0.0-beta.49",
"@babel/plugin-transform-property-mutators": "7.0.0-beta.49",
"@babel/plugin-transform-proto-to-assign": "7.0.0-beta.49",
"@babel/plugin-transform-react-constant-elements": "7.0.0-beta.49",
"@babel/plugin-transform-react-display-name": "7.0.0-beta.49",
"@babel/plugin-transform-react-inline-elements": "7.0.0-beta.49",
"@babel/plugin-transform-react-jsx": "7.0.0-beta.49",
"@babel/plugin-transform-react-jsx-compat": "7.0.0-beta.49",
"@babel/plugin-transform-react-jsx-self": "7.0.0-beta.49",
"@babel/plugin-transform-react-jsx-source": "7.0.0-beta.49",
"@babel/plugin-transform-regenerator": "7.0.0-beta.49",
"@babel/plugin-transform-runtime": "7.0.0-beta.49",
"@babel/plugin-transform-shorthand-properties": "7.0.0-beta.49",
"@babel/plugin-transform-spread": "7.0.0-beta.49",
"@babel/plugin-transform-sticky-regex": "7.0.0-beta.49",
"@babel/plugin-transform-strict-mode": "7.0.0-beta.49",
"@babel/plugin-transform-template-literals": "7.0.0-beta.49",
"@babel/plugin-transform-typeof-symbol": "7.0.0-beta.49",
"@babel/plugin-transform-typescript": "7.0.0-beta.49",
"@babel/plugin-transform-unicode-regex": "7.0.0-beta.49",
"@babel/preset-es2015": "7.0.0-beta.49",
"@babel/preset-es2016": "7.0.0-beta.49",
"@babel/preset-es2017": "7.0.0-beta.49",
"@babel/preset-flow": "7.0.0-beta.49",
"@babel/preset-react": "7.0.0-beta.49",
"@babel/preset-stage-0": "7.0.0-beta.49",
"@babel/preset-stage-1": "7.0.0-beta.49",
"@babel/preset-stage-2": "7.0.0-beta.49",
"@babel/preset-stage-3": "7.0.0-beta.49",
"@babel/preset-typescript": "7.0.0-beta.49"
"@babel/core": "7.0.0-beta.50",
"@babel/plugin-external-helpers": "7.0.0-beta.50",
"@babel/plugin-proposal-async-generator-functions": "7.0.0-beta.50",
"@babel/plugin-proposal-class-properties": "7.0.0-beta.50",
"@babel/plugin-proposal-decorators": "7.0.0-beta.50",
"@babel/plugin-proposal-do-expressions": "7.0.0-beta.50",
"@babel/plugin-proposal-export-default-from": "7.0.0-beta.50",
"@babel/plugin-proposal-export-namespace-from": "7.0.0-beta.50",
"@babel/plugin-proposal-function-bind": "7.0.0-beta.50",
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.50",
"@babel/plugin-proposal-optional-catch-binding": "7.0.0-beta.50",
"@babel/plugin-proposal-pipeline-operator": "7.0.0-beta.50",
"@babel/plugin-proposal-unicode-property-regex": "7.0.0-beta.50",
"@babel/plugin-syntax-async-generators": "7.0.0-beta.50",
"@babel/plugin-syntax-class-properties": "7.0.0-beta.50",
"@babel/plugin-syntax-decorators": "7.0.0-beta.50",
"@babel/plugin-syntax-do-expressions": "7.0.0-beta.50",
"@babel/plugin-syntax-dynamic-import": "7.0.0-beta.50",
"@babel/plugin-syntax-export-default-from": "7.0.0-beta.50",
"@babel/plugin-syntax-export-namespace-from": "7.0.0-beta.50",
"@babel/plugin-syntax-flow": "7.0.0-beta.50",
"@babel/plugin-syntax-function-bind": "7.0.0-beta.50",
"@babel/plugin-syntax-function-sent": "7.0.0-beta.50",
"@babel/plugin-syntax-import-meta": "7.0.0-beta.50",
"@babel/plugin-syntax-jsx": "7.0.0-beta.50",
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.50",
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.50",
"@babel/plugin-syntax-pipeline-operator": "7.0.0-beta.50",
"@babel/plugin-syntax-typescript": "7.0.0-beta.50",
"@babel/plugin-transform-arrow-functions": "7.0.0-beta.50",
"@babel/plugin-transform-async-to-generator": "7.0.0-beta.50",
"@babel/plugin-transform-block-scoped-functions": "7.0.0-beta.50",
"@babel/plugin-transform-block-scoping": "7.0.0-beta.50",
"@babel/plugin-transform-classes": "7.0.0-beta.50",
"@babel/plugin-transform-computed-properties": "7.0.0-beta.50",
"@babel/plugin-transform-destructuring": "7.0.0-beta.50",
"@babel/plugin-transform-dotall-regex": "7.0.0-beta.50",
"@babel/plugin-transform-duplicate-keys": "7.0.0-beta.50",
"@babel/plugin-transform-exponentiation-operator": "7.0.0-beta.50",
"@babel/plugin-transform-flow-comments": "7.0.0-beta.50",
"@babel/plugin-transform-flow-strip-types": "7.0.0-beta.50",
"@babel/plugin-transform-for-of": "7.0.0-beta.50",
"@babel/plugin-transform-function-name": "7.0.0-beta.50",
"@babel/plugin-transform-instanceof": "7.0.0-beta.50",
"@babel/plugin-transform-jscript": "7.0.0-beta.50",
"@babel/plugin-transform-literals": "7.0.0-beta.50",
"@babel/plugin-transform-member-expression-literals": "7.0.0-beta.50",
"@babel/plugin-transform-modules-amd": "7.0.0-beta.50",
"@babel/plugin-transform-modules-commonjs": "7.0.0-beta.50",
"@babel/plugin-transform-modules-systemjs": "7.0.0-beta.50",
"@babel/plugin-transform-modules-umd": "7.0.0-beta.50",
"@babel/plugin-transform-new-target": "7.0.0-beta.50",
"@babel/plugin-transform-object-assign": "7.0.0-beta.50",
"@babel/plugin-transform-object-set-prototype-of-to-assign": "7.0.0-beta.50",
"@babel/plugin-transform-object-super": "7.0.0-beta.50",
"@babel/plugin-transform-parameters": "7.0.0-beta.50",
"@babel/plugin-transform-property-literals": "7.0.0-beta.50",
"@babel/plugin-transform-property-mutators": "7.0.0-beta.50",
"@babel/plugin-transform-proto-to-assign": "7.0.0-beta.50",
"@babel/plugin-transform-react-constant-elements": "7.0.0-beta.50",
"@babel/plugin-transform-react-display-name": "7.0.0-beta.50",
"@babel/plugin-transform-react-inline-elements": "7.0.0-beta.50",
"@babel/plugin-transform-react-jsx": "7.0.0-beta.50",
"@babel/plugin-transform-react-jsx-compat": "7.0.0-beta.50",
"@babel/plugin-transform-react-jsx-self": "7.0.0-beta.50",
"@babel/plugin-transform-react-jsx-source": "7.0.0-beta.50",
"@babel/plugin-transform-regenerator": "7.0.0-beta.50",
"@babel/plugin-transform-runtime": "7.0.0-beta.50",
"@babel/plugin-transform-shorthand-properties": "7.0.0-beta.50",
"@babel/plugin-transform-spread": "7.0.0-beta.50",
"@babel/plugin-transform-sticky-regex": "7.0.0-beta.50",
"@babel/plugin-transform-strict-mode": "7.0.0-beta.50",
"@babel/plugin-transform-template-literals": "7.0.0-beta.50",
"@babel/plugin-transform-typeof-symbol": "7.0.0-beta.50",
"@babel/plugin-transform-typescript": "7.0.0-beta.50",
"@babel/plugin-transform-unicode-regex": "7.0.0-beta.50",
"@babel/preset-es2015": "7.0.0-beta.50",
"@babel/preset-es2016": "7.0.0-beta.50",
"@babel/preset-es2017": "7.0.0-beta.50",
"@babel/preset-flow": "7.0.0-beta.50",
"@babel/preset-react": "7.0.0-beta.50",
"@babel/preset-stage-0": "7.0.0-beta.50",
"@babel/preset-stage-1": "7.0.0-beta.50",
"@babel/preset-stage-2": "7.0.0-beta.50",
"@babel/preset-stage-3": "7.0.0-beta.50",
"@babel/preset-typescript": "7.0.0-beta.50"
},

@@ -100,0 +100,0 @@ "keywords": [

@@ -1,92 +0,19 @@

@babel/standalone
================
# @babel/standalone
@babel/standalone is a standalone build of Babel for use in non-Node.js environments, including browsers. It's bundled with all the standard Babel plugins and presets, and [a build of babili (babel-minify)](http://dl.vc/babili-standalone) is optionally available too.
> Standalone build of Babel for use in non-Node.js environments.
But why?!
=========
See our website [@babel/standalone](https://new.babeljs.io/docs/en/next/babel-standalone.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20standalone%22+is%3Aopen) associated with this package.
It's true that using Babel through Webpack, Browserify or Gulp should be sufficient for most use cases. However, there are some valid use cases for @babel/standalone:
## Install
- Sites like [JSFiddle](https://jsfiddle.net/), [JS Bin](https://jsbin.com/), the [REPL on the Babel site](http://babeljs.io/repl/), etc. These sites compile user-provided JavaScript in real-time.
- Apps that embed a JavaScript engine such as V8 directly, and want to use Babel for compilation
- Apps that want to use JavaScript as a scripting language for extending the app itself, including all the goodies that ES2015 provides.
- Integration of Babel into a non-Node.js environment ([ReactJS.NET](http://reactjs.net/), [ruby-babel-transpiler](https://github.com/babel/ruby-babel-transpiler), [php-babel-transpiler](https://github.com/talyssonoc/php-babel-transpiler), etc).
Using npm:
Installation
============
There are several ways to get a copy of @babel/standalone. Pick whichever one you like:
- Use it via UNPKG: https://unpkg.com/@babel/standalone/babel.min.js. This is a simple way to embed it on a webpage without having to do any other setup.
- Install via NPM: `npm install --save @babel/standalone`
- Manually grab `babel.js` and/or `babel.min.js` from the [GitHub releases page](https://github.com/Daniel15/babel-standalone/releases). Every release includes these files.
- Install it via Git: You can use the repo at https://github.com/Daniel15/babel-standalone-bower to pull a prebuilt version from Git. Note that this is generally only advised for systems that *must* pull artifacts from Git, such as Bower.
Usage
=====
Load `babel.js` or `babel.min.js` in your environment. This will expose [Babel's API](http://babeljs.io/docs/usage/api/) in a `Babel` object:
```js
var input = 'const getMessage = () => "Hello World";';
var output = Babel.transform(input, { presets: ['es2015'] }).code;
```sh
npm install --save @babel/standalone
```
When loaded in a browser, @babel/standalone will automatically compile and execute all script tags with type `text/babel` or `text/jsx`:
```html
<div id="output"></div>
<!-- Load Babel -->
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<!-- Your custom script here -->
<script type="text/babel">
const getMessage = () => "Hello World";
document.getElementById('output').innerHTML = getMessage();
</script>
```
or using yarn:
You can use the `data-plugins` and `data-presets` attributes to specify the Babel plugins/presets to use:
```html
<script type="text/babel" data-presets="es2015,stage-2">
```sh
yarn add --save @babel/standalone
```
Loading external scripts via `src` attribute is supported too:
```html
<script type="text/babel" src="foo.js"></script>
```
Note that `.babelrc` doesn't work in @babel/standalone, as no file system access is available. The presets and/or plugins to use **must** be specified in the options passed to `Babel.transform`.
Customisation
=============
Custom plugins and presets can be added using the `registerPlugin` and `registerPreset` methods respectively:
```js
// Simple plugin that converts every identifier to "LOL"
function lolizer() {
return {
visitor: {
Identifier(path) {
path.node.name = 'LOL';
}
}
}
}
Babel.registerPlugin('lolizer', lolizer);
```
Once registered, just use the name of the plugin:
```js
var output = Babel.transform(
'function helloWorld() { alert(hello); }',
{plugins: ['lolizer']}
);
// Returns "function LOL() { LOL(LOL); }"
```
Custom plugins also work for inline `<script>`s:
```html
<script type="text/babel" data-plugins="lolizer">
```

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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